Skip to content

Commit

Permalink
Require Addressable >= 2.8.1 & PublicSuffix >= 4.0.3
Browse files Browse the repository at this point in the history
Since `PublicSuffix` v4.0.3, it is possible to parse the URL `http://+%D5d.some_site.net`.

It is also possible to normalize the URL since `Addressable` v2.8.1, which includes this fix: sporkmonger/addressable#459.

Hence, this is now a valid URL, which means that it should be moved to the `valid_urls` array in the specs.

`PublicSuffix` 4.x is supported by `Addressable` since v2.7.0 (see https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#addressable-270).
  • Loading branch information
Pontus4 committed Aug 23, 2022
1 parent c1cc043 commit 5ae3a68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/lib/twingly/url_spec.rb
Expand Up @@ -44,7 +44,6 @@ def invalid_urls
# https://github.com/twingly/twingly-url/issues/62
# https://github.com/sporkmonger/addressable/issues/224
"http://some_site.net%C2",
"http://+%D5d.some_site.net",

# Triggers Addressable::IDNA::PunycodeBigOutput
"http://40world-many.ru&passwd=pUXFGc0LS5&subject=%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%B0+%D0%BA%D0%B0%D1%80%D0%B4%D0%B0%D0%BD%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B2%D0%B0%D0%BB%D0%B0&commit=Predict&complex=true&complex=false&membrane=false&coil=false&msa_control=all&secStructPred=true&secStructPred=false&falseRate=5&output=opnone&modeller=&seqalign=yes&database=PfamA&eval=0.01&iterations=5&domssea=yes&secpro=yes&pp=yes",
Expand All @@ -66,6 +65,7 @@ def valid_urls
"https://www.foo.ایران.ir/bar",
"https://www.foo.xn--mgba3a4f16a.ir/bar",
"http://AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallumEst.com",
"http://+%D5d.some_site.net",
]
end

Expand Down
4 changes: 2 additions & 2 deletions twingly-url.gemspec
Expand Up @@ -14,8 +14,8 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.required_ruby_version = ">= 2.5"

s.add_dependency "addressable", "~> 2.6"
s.add_dependency "public_suffix", ">= 3.0.1", "< 6.0"
s.add_dependency "addressable", ">= 2.8.1"
s.add_dependency "public_suffix", ">= 4.0.3", "< 6.0"

s.add_development_dependency "rake", "~> 12"
s.add_development_dependency "rspec", "~> 3"
Expand Down

0 comments on commit 5ae3a68

Please sign in to comment.