Return "null" as origin for opaque origin
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: cybai, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0
Steps to reproduce:
Check "Parsing origin: <ssh://example.com/foo/bar.git> against http://example.org/" test case in url/a-element-origin.html from WPT.
Actual results:
"ssh://example.com" is returned as origin for "ssh://example.com/foo/bar.git".
Expected results:
based on the expected result, the origin should be "null".
| Reporter | ||
Comment 1•3 years ago
|
||
Based on my current investigation and also https://url.spec.whatwg.org/#origin, I wonder the failure is caused by missing checking the URL scheme is special or not in https://searchfox.org/mozilla-central/rev/cd2121e7d83af1b421c95e8c923db70e692dab5f/dom/base/nsContentUtils.cpp#6510-6557.
:valentin, would you think it sounds correct to you to add a scheme checking to match the spec (https://url.spec.whatwg.org/#origin) in nsContentUtils::GetASCIIOrigin function?
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•3 years ago
|
||
We are already tracking this in bug 1553105.
The reason why we haven't landed it yet is that internally (in Firefox, Thunderbird, webextensions) we may want the origin to work for non-special schemes too.
We'll probably tackle this in the next few months.
| Reporter | ||
Comment 4•3 years ago
|
||
Thank you for pointing to the bug and explaining the reason. I will track this from that bug. 🙏
Description
•