-
Notifications
You must be signed in to change notification settings - Fork 30k
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
WHATWG URL inconsistent 'origin' property #21955
Comments
/cc @nodejs/url |
This is unfortunately one of the unspecified areas in the URL Standard. See https://url.spec.whatwg.org/#concept-url-origin:
We followed the "when in doubt" instruction, but it did come as a surprise to me to find that whatwg-url doesn't. |
Firefox also returns |
Yup, seems like NodeJS is more inline with the specification. Is it worth moving upstream to Safari, Chrome, WHATWG URL to see what they think? I imagine there would be resistance to change as it might break backwards compatibility and, as it reads, they are compliant. I feel like the spec should really be tightened up there and just make everything return a |
Have updated the OP with the new information about the inconsistencies. |
I don't think getting browsers to align with each other is within the scope of this project. I am pretty certain what we do is a fair behavior, and I'm going to file an issue at whatwg-url encouraging them to do the same as we do (pretty sure they'd agree), and then close this issue. How's that sound? |
Yup, totally on-board with that. |
The
whatwg-url
npm
package andURL
class in Chrome/Safari perform the following withfile://
URLs:However, the built-in
'url'
module and Firefox perform the following:There is an inconsistency here. I had a look at the internal
url.js
and I'm not sure if the specification allows an opaque origin in this situation. I'd thought I report in case someone more familiar with the specification can determine if the inconsistency is allowed by the specification.The text was updated successfully, but these errors were encountered: