Missing Origin header when requests to the same-origin and crossorigin set
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: me, Assigned: CuveeHsu)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Comment 5•6 years ago
|
||
I suspect this is https://github.com/whatwg/fetch/issues/871 in part (there other browsers are also not sending the header though).
Updated•6 years ago
|
Comment 6•5 years ago
|
||
Per https://github.com/web-platform-tests/wpt/pull/22567 browsers do not send the Origin header for CORS same-origin GET, but we do fail a couple of cases there we should probably fix.
| Assignee | ||
Comment 7•5 years ago
|
||
Thanks. Will fix when the change in wpt is merged to central.
| Assignee | ||
Comment 8•5 years ago
|
||
(In reply to Anne (:annevk) from comment #6)
Per https://github.com/web-platform-tests/wpt/pull/22567 browsers do not send the Origin header for CORS same-origin GET, but we do fail a couple of cases there we should probably fix.
Sorry for a late weighing in.
The only additional failure is
"Origin header and POST same-origin fetch cors mode with Referrer-Policy no-referrer"
"assert_equals: expected "null" but got "http://web-platform.test:8000"
However the change which fails us isn't about the GET/CORS combination
https://searchfox.org/mozilla-central/diff/a435a8c59595dad833c7368912ea9c2dfbbf948b/testing/web-platform/tests/fetch/origin/assorted.window.js#197-198
We can translate the test to:
if mode == cors && it's a cross-origin fetch ==> ignore the referrer-policy
but the spec change is stopped (and possible not match the test) https://github.com/whatwg/fetch/pull/1013
What do you think, Anne?
Do you think it's a right move? Or we need to ask the rationale?
Comment 9•5 years ago
|
||
The current specification at https://fetch.spec.whatwg.org/#append-a-request-origin-header does not look at whether the request's mode is "cors", it looks at whether request's response tainting is "cors". For that to happen a request with mode "cors" would have had to go through a cross-origin URL at some point. So in the same-origin case the otherwise branch kicks in here. Hope that helps.
| Assignee | ||
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
| bugherder | ||
Comment 13•5 years ago
|
||
This fix causes a regression that results in Origin: null for same-origin requests with Referrer-Policy: no-referrer. See bug 1632204.
Description
•