Do not override the Priority header when set by the user
Categories
(Core :: Networking: HTTP, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: valentin, Assigned: sekim)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged][necko-priority-next])
Attachments
(1 file)
See conversation about chrome behaviour Define behavior for Priority
request header · Issue 1718 · whatwgfetch
At least in the case of Chrome, if the Priority header is set before it gets to the networking stack then the user-supplied value will be used (like was discussed above).
I think the fix would be rather simple:
https://searchfox.org/mozilla-central/rev/dc08a7321a22918d5a26b7641f9b10cd2a09d98e/netwerk/protocol/http/nsHttpChannel.cpp#488-491
void nsHttpChannel::SetPriorityHeader() {
nsAutoCString userSetPriority;
Unused << GetRequestHeader("Priority"_ns, userSetPriority);
if (!userSetPriority.IsEmpty()) {
// insert comment here :)
return;
}
uint8_t urgency =
nsHttpHandler::UrgencyFromCoSFlags(mClassOfService.Flags(), mPriority);
bool incremental = mClassOfService.Incremental();
Reporter | ||
Updated•1 month ago
|
Reporter | ||
Comment 1•1 month ago
|
||
See also https://github.com/whatwg/fetch/issues/1718#issuecomment-2145347776
The Priority header implementation in Chrome and Firefox ignores the existence of the request filtering engine available to extensions. declarativeNetRequest and webRequest do not see the header because it is set by the browser after request filtering occurs, so extensions cannot remove the header, they will only be able to set a custom value.
We should also consider moving the call to SetPriorityHeader a bit earlier to allow webextensions to change/remove the value.
Updated•25 days ago
|
Updated•21 days ago
|
Updated•21 days ago
|
Updated•15 days ago
|
Updated•15 days ago
|
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a92033df002 Do not override the Priority header when set by the user and move SetPriorityHeader call before onModifyRequest r=necko-reviewers,kershaw,devtools-reviewers,bomsy
Updated•8 days ago
|
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f58630eb7af Do not override the Priority header when set by the user r=necko-reviewers,kershaw,devtools-reviewers,bomsy,webdriver-reviewers,whimboo
Comment 6•3 days ago
|
||
bugherder |
Description
•