-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Inconsistency between new URL behavior in Nodejs and browser #30223
Comments
From what I've tested, only Firefox throws an error. But Node.js' result is still different from Chrome or Edge: Test:
/cc @nodejs/url |
It'd be good to test Safari as well, as it generally matches the spec. (Which matches whatwg-url and Node.js.) If no browsers match the spec/Node.js/whatwg-url, then it's worth opening a new issue on https://github.com/whatwg/url/ to get the spec fixed. But if it's a case where the three existing browsers (Edge is dead) all do different results, and one of them matches the spec, then probably the two wrong browsers should change. |
In that case we have 2/3 browsers throwing an error so the spec should probably be updated to match. Please do open an issue there. After the appropriate spec update goes through then Node.js and whatwg-url can update to follow. |
Opened one at whatwg/url#458. |
Fixed by #33328? The inconsistency is still there, but it will go away as the browsers catch up with the updated spec. Refs: https://bugs.webkit.org/show_bug.cgi?id=211901 |
I confirmed the original issue has been fixed already by #33328. Closing as resolved. Thank you. |
Node 12.10.0
macOS 64bit
When using
new URL
in Nodejs the result of passing an invalid URL to the constructor is inconsistent with the result returned by the same call inside the browser. For example(whereurl == https://<script></script>
:running the above in browser devtools return the following expected result:
Running the same in Nodejs, returns the following:
The text was updated successfully, but these errors were encountered: