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

Url pathname is getting encoded after normalization #165

Open
psamusev opened this issue Apr 20, 2022 · 1 comment
Open

Url pathname is getting encoded after normalization #165

psamusev opened this issue Apr 20, 2022 · 1 comment

Comments

@psamusev
Copy link

The current behavior of
urlObject.pathname = decodeURI(urlObject.pathname);
doesn't work as expected. Since URL automatically always encode any value that we set, according to https://developer.mozilla.org/en-US/docs/Web/API/URL

URLs are encoded according to the rules found in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)

Example:
normalizeUrl('http://host.com/api/user/{userId}') returns 'http://host.com/api/user/%7BuserId%7D'

@sindresorhus
Copy link
Owner

You commented on the incorrect pull request. The relevant code was added in #31.

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

2 participants