Closed sondrele closed 7 years ago
Hello!
I've tried replacing the built in url node module with uri-js because of the need to support more than just URL's.
url
uri-js
However, I'm running into a problem when it comes to URI's that contains \r, consider the following example:
\r
Code:
let url = require("url") console.log(url.resolve("#", "#foo\nbar")) console.log(url.resolve("#", "#foo\rbar")) let URI = require("uri-js@2.1.1") console.log(URI.resolve("#", "#foo\nbar")) console.log(URI.resolve("#", "#foo\rbar"))
Output:
"#foo%0Abar" "#foo%0Dbar" "#foo%0Abar" "#foo"
I had expected uri-js to behave similar as url in the code above, but instead \rbar seems to be excluded when uri-js tries to resolve it.
\rbar
There's also some other behaviour here, because the following code works:
console.log(URI.resolve("#", "foo\rbar")) // === "foo%0Dbar"
Do you know what the problem might be?
Thanks
Fixed and closed by #20.
Hello!
I've tried replacing the built in
url
node module withuri-js
because of the need to support more than just URL's.However, I'm running into a problem when it comes to URI's that contains
\r
, consider the following example:Code:
Output:
I had expected
uri-js
to behave similar asurl
in the code above, but instead\rbar
seems to be excluded whenuri-js
tries to resolve it.There's also some other behaviour here, because the following code works:
Do you know what the problem might be?
Thanks