From f0210b5863a541306f799f0689251159694b86b6 Mon Sep 17 00:00:00 2001 From: Eric Firth Date: Thu, 4 Jan 2024 10:13:51 -0500 Subject: [PATCH] Remove monkey patch from Addressable::URI#normalized_query so that it can be compatible with Addressable 2.8.2 --- lib/postrank-uri.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/postrank-uri.rb b/lib/postrank-uri.rb index 30f763b..5bf4f94 100644 --- a/lib/postrank-uri.rb +++ b/lib/postrank-uri.rb @@ -11,22 +11,6 @@ def domain host = self.host (host && PublicSuffix.valid?(host, default_rule: nil)) ? PublicSuffix.parse(host).domain : nil end - - def normalized_query - @normalized_query ||= (begin - if self.query && self.query.strip != '' - (self.query.strip.split("&", -1).map do |pair| - Addressable::URI.normalize_component( - pair, - Addressable::URI::CharacterClasses::QUERY.sub("\\&", "") - ) - end).join("&") - else - nil - end - end) - end - end end @@ -152,6 +136,7 @@ def hash(uri, opts = {}) end def normalize(uri, opts = {}) + uri = uri.to_s.split(' ').first u = parse(uri, opts) u.path = u.path.gsub(URIREGEX[:double_slash_outside_scheme], '/') u.path = u.path.chomp('/') if u.path.size != 1