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

normalized_encode incorrectly unencodes %26 to & #424

Open
davidtaylorhq opened this issue Jul 28, 2021 · 1 comment
Open

normalized_encode incorrectly unencodes %26 to & #424

davidtaylorhq opened this issue Jul 28, 2021 · 1 comment

Comments

@davidtaylorhq
Copy link
Contributor

When a query parameter includes %26, normalized_encode replaces it with a literal &, which results in a different URI:

pry(main)> Addressable::URI.normalized_encode("https://example.com?foo=bar%26baz")
=> "https://example.com?foo=bar&baz"

The more comprehensive URI#normalize method works correctly:

pry(main)> Addressable::URI.parse("https://example.com?foo=bar%26baz").normalize.to_s
=> "https://example.com/?foo=bar%26baz"

This issue is possibly related to #366 and #386. However, both of those issues apply to URI#normalize, wheras this %26 issue only seems to apply to the normalized_encode method.

Repository owner deleted a comment Jan 13, 2022
@dentarg
Copy link
Collaborator

dentarg commented Jul 19, 2023

I think this issue is the same as #366 but I'll keep this one open until it has been addressed.

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

No branches or pull requests

3 participants
@dentarg @davidtaylorhq and others