We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
16.14.0
No response
Run the following code with nodejs v15 and v16 gets different output.
const { parse } = require( 'url' ); parse( '//foo@bar' );
Output with nodejs 14:
{ protocol: null, slashes: null, auth: null, host: null, port: null, hostname: null, hash: null, search: null, query: null, pathname: "//foo@bar", path: "//foo@bar", href: "//foo@bar" }
Output with nodejs 16:
{ protocol: null, slashes: true, auth: "foo", host: "bar", port: null, hostname: "bar", hash: null, search: null, query: null, pathname: null, path: null, href: "//foo@bar" }
https://runkit.com/62249077dc641400085658be/6224907756c9c7000882de7a
I am not sure if it's a bug or not, but it's changed and cannot be found from documentation. https://nodejs.org/dist/latest-v16.x/docs/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehost
The text was updated successfully, but these errors were encountered:
This was a bug fix in #41031.
In 14.x, adding a hash to the path changed the behavior which seemed surprising to put it mildly.
> url.parse('//foo@bar/what') Url { protocol: null, slashes: null, auth: null, host: null, port: null, hostname: null, hash: null, search: null, query: null, pathname: '//foo@bar/what', path: '//foo@bar/what', href: '//foo@bar/what' } > url.parse('//foo@bar/what#hey') Url { protocol: null, slashes: true, auth: 'foo', host: 'bar', port: null, hostname: 'bar', hash: '#hey', search: null, query: null, pathname: '/what', path: '/what', href: '//foo@bar/what#hey' } >
In 16.x, the behavior is consistent with or without the hash.
Sorry, something went wrong.
I'm going to close this, but feel free to re-open or comment if there's more to discuss.
No branches or pull requests
Version
16.14.0
Platform
No response
Subsystem
No response
What steps will reproduce the bug?
Run the following code with nodejs v15 and v16 gets different output.
Output with nodejs 14:
Output with nodejs 16:
https://runkit.com/62249077dc641400085658be/6224907756c9c7000882de7a
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
I am not sure if it's a bug or not, but it's changed and cannot be found from documentation.
https://nodejs.org/dist/latest-v16.x/docs/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehost
Additional information
No response
The text was updated successfully, but these errors were encountered: