From 5ae3a6838cf1202d1969568773f06681342dc261 Mon Sep 17 00:00:00 2001 From: Pontus Svensson Date: Tue, 23 Aug 2022 14:53:49 +0200 Subject: [PATCH] Require `Addressable` >= 2.8.1 & `PublicSuffix` >= 4.0.3 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: https://github.com/sporkmonger/addressable/pull/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). --- spec/lib/twingly/url_spec.rb | 2 +- twingly-url.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/lib/twingly/url_spec.rb b/spec/lib/twingly/url_spec.rb index 04be030..6822ee9 100644 --- a/spec/lib/twingly/url_spec.rb +++ b/spec/lib/twingly/url_spec.rb @@ -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", @@ -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 diff --git a/twingly-url.gemspec b/twingly-url.gemspec index 10e1ae1..8af38ea 100644 --- a/twingly-url.gemspec +++ b/twingly-url.gemspec @@ -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"