Don't set Sec-Fetch-* headers if a channel is used for a download
Categories
(Core :: Networking: HTTP, defect, P2)
Tracking
()
People
(Reporter: KaiE, Assigned: mkmelin)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file, 2 obsolete files)
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr115+
|
Details | Review |
Bug 1803739 needs an additional load flag, to selectively prevent that Sec-Fetch-* headers are sent.
Unfortunately there is no more room more additional flags in the existing nsIRequest.loadFlags attribute:
0:00.96 xpidl.xpidl.IDLError: error: xpidl constants must fit within uint32_t, /home/user/moz/commcent/mozilla/netwerk/base/nsIChannel.idl line 292:4
0:00.96 const unsigned long LOAD_NO_SEC_FETCH_HEADERS = 1 << 32;
This patch suggests to introduce an additional loadFlags2 attribute for storing additional flags.
Reporter | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
Valentin explained we don't need a new load flag, but can instead use nsIHttpChannelInternal.
And in the meantime, in bug 1803739, Freddy suggested we should use a more general flag like "this is a download".
Combining these, I see that nsIHttpChannelInternal already has an attribute channelIsForDownload.
Based on Freddy's suggestion, we could omit the sec-fetch-* headers if channelIsForDownload is set to true.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 4•2 years ago
|
||
Would someone from the Necko team be able to point us to an existing test, which would be suited as an example for adding a test?
IIUC, we need a test that creates an XMLHttpRequest, see the new flag, then receive the headers that are generated by the request, and check that these headers aren't present?
Probably the test will need to be even more advanced, because it needs to operate in a context that would normally produce the Sec-Fetch-* flags? Do we need to have a related parent request?
Any pointers/suggestions would be very much appreciated.
Reporter | ||
Comment 5•2 years ago
|
||
I found toolkit/components/extensions/test/xpcshell/test_ext_secfetch.js
Would that be a good starting point?
It uses "fetch" (not XMLHttpRequest). Is there a way to set an attribute of nsIHttpChannelInternal when using fetch?
Comment 6•2 years ago
|
||
dom/xhr/tests/test_XHR_anon.html is a test where XMLHttpRequest()
is making use of advanced preferences.
dom/xhr/tests/test_XHR_parameters.html is testing the privilege questions.
Reporter | ||
Comment 7•2 years ago
|
||
Sorry I cannot make the remaining work a priority right now.
Assignee | ||
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
bugherder |
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 11•2 years ago
|
||
Comment on attachment 9339039 [details]
Bug 1819592 - Don't set Sec- headers for system requests. r=freddyb,ckerschb
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Makes reading of rss feeds from some major sites like Feedburner work in Thunderbird.
- User impact if declined: Feed reading won't work.
- Fix Landed on Version: 117
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It only affects requests/fetches from privileged code, in combination with the server reacting differently to Sec- headers.
Probably such cases do not exist for Firefox.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment on attachment 9339039 [details]
Bug 1819592 - Don't set Sec- headers for system requests. r=freddyb,ckerschb
Approved for 115.2esr.
Comment 13•2 years ago
|
||
uplift |
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Description
•