postrank-labs / postrank-uri

URI normalization, c14n, escaping, and extraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove Addressable monkey patch?

dentarg opened this issue · comments

From Addressable 2.8.2 it no longer works:

$ ruby -rbundler/inline -e 'gemfile do; source "https://rubygems.org"; gem "postrank-uri"; gem "addressable", "2.8.2"; end; Addressable::URI.parse("google.com").normalize'
/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:1636:in `query=': Can't convert Object into String. (TypeError)

        raise TypeError, "Can't convert #{new_query.class} into String."
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:851:in `block in initialize'
	from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:2392:in `defer_validation'
	from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:840:in `initialize'
	from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:2168:in `new'
	from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/addressable-2.8.2/lib/addressable/uri.rb:2168:in `normalize'
	from -e:1:in `<main>'

Seeing the patch is soon 12 years old, 110ed0b, is it still needed?

Was originally reported in sporkmonger/addressable#506

Yes, probably due for an update! Would you be willing to stage a PR?

I'm not using postrank but maybe @danielnolan or @rickyc or @ck250186 is up for it! (users that reported the problem in the first place)