Skip to content

Commit

Permalink
Keep using URI::RFC2396_PARSER parser
Browse files Browse the repository at this point in the history
The default parser in URI 1.0.0 / Ruby 3.4 has been changed to RFC3986
[[1]]. This causes test failures such as:

~~~
... snip ...

Failure:
GlobalIDTest#test_invalid_app_name [test/cases/global_id_test.rb:13]:
ArgumentError expected but nothing was raised.

rails test test/cases/global_id_test.rb:8

F

... snip ...
~~~

where underscores / ampersands are now allowed in host. Keep using
`URI::RFC2396_PARSER` for compatibility.

Fixes #190

[1]: ruby/uri#107
  • Loading branch information
voxik committed Dec 13, 2024
1 parent 488ab6c commit 5d30d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/global_id/uri/gid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def validate_app(app)
# URI.parse('gid://bcx') # => URI::GID instance
# URI::GID.parse('gid://bcx/') # => raises URI::InvalidComponentError
def parse(uri)
generic_components = URI.split(uri) << nil << true # nil parser, true arg_check
generic_components = URI.split(uri) << URI::RFC2396_PARSER << true # nil parser, true arg_check
new(*generic_components)
end

Expand Down

0 comments on commit 5d30d69

Please sign in to comment.