Closed freearhey closed 2 years ago
That's unforunately expected since normalize-url
uses URL.searchParams()
under the hood which follows different rules from the IETF URI spec since it is based on the WHATWG URL spec https://nodejs.org/api/url.html#urlsearchparams.
Got it.
why closed.
because my question was answered
how to resolve
pass the output string through the decodeURIComponent():
decodeURIComponent('http://sindresorhus.com/?url=http%3A%2F%2Fexample.com')
// => 'http://sindresorhus.com/?url=http://example.com'
pass the output string through the decodeURIComponent():
decodeURIComponent('http://sindresorhus.com/?url=http%3A%2F%2Fexample.com') // => 'http://sindresorhus.com/?url=http://example.com'
Wow! Good find. But what if the original URL parameters were encoded?
I've made a PR to always decode the parameters, since after all the package name starts with normalize-
:-)
Is it supposed to be like this?
sortQueryParameters: true
sortQueryParameters: false