Closed Bug 1821343 Opened 3 years ago Closed 3 years ago

Return "null" as origin for opaque origin

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 110
defect

Tracking

()

RESOLVED DUPLICATE of bug 1553105

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".

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?

Flags: needinfo?(valentin.gosu)

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.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

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.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Duplicate of bug: 1553105
Flags: needinfo?(valentin.gosu)
Resolution: --- → DUPLICATE

Thank you for pointing to the bug and explaining the reason. I will track this from that bug. 🙏

You need to log in before you can comment on or make changes to this bug.