Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalization throws for relative path with colon ':' #550

Open
Bubbis opened this issue Feb 23, 2025 · 0 comments
Open

Normalization throws for relative path with colon ':' #550

Bubbis opened this issue Feb 23, 2025 · 0 comments

Comments

@Bubbis
Copy link

Bubbis commented Feb 23, 2025

13] pry(main)> u = Addressable::URI.parse('../folder:2/readme.md')
=> #<Addressable::URI:0x1de84 URI:../folder:2/readme.md>
[14] pry(main)> u.normalize
Addressable::URI::InvalidURIError: Cannot assemble URI string with ambiguous path: 'folder:2/readme.md'
from /Users/bubbis/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/addressable-2.8.7/lib/addressable/uri.rb:2344:in `to_s'

I expect folder%2F2/readme.md and a successful return. Should that be the case? The issue would then point to the regex below which does not take the relative part into account which gets trimmed as per standard.

if self.scheme == nil && path =~ NORMPATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant