-
Notifications
You must be signed in to change notification settings - Fork 137
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
new URL('file://').origin is 'null' #310
Comments
You'll need to elaborate more on why it's not useful. Opaque origins always serialize to "null". |
(And I don't think what you state goes for each browser by the way.) |
In Chrome, all non-special schemes and file scheme URLs that I can find have origins of scheme + |
Filed https://bugs.chromium.org/p/chromium/issues/detail?id=722089 though I think it might be a duplicate. |
Thanks, I updated the first message. I don't agree a lot with this 'null', it's like losing information, but I'll do with it |
Yes duplicate, someone filed this bug a year ago: https://bugs.chromium.org/p/chromium/issues/detail?id=608606 |
Am I the only one who thinks it sounds terrible, like a bug, to have any segment be serialized to the literal string |
Unlike other URL origins serve a very specific purpose in the web security model and one shouldn’t think of it as a part of the URL in general. This is also why
I don’t remember a case where |
Thanks for the explanation. Still, why string |
Yes it has a meaning, see https://html.spec.whatwg.org/#ascii-serialisation-of-an-origin. You'll also find it with CORS, |
Also, |
Got it, makes sense to align with the HTML spec then (even though it still seems weird to me) |
var {URL}=require('url'); new URL('file://').origin
is 'null' on Node.js.This result is not helpful/practical, I think it should be
'file://'
like in browser (Chrome 58/Linux), or an empty stringedit: indeed Firefox outputs 'null' too
The text was updated successfully, but these errors were encountered: