-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define behavior for Priority
request header
#1718
Comments
This is why cc @whatwg/http |
I can't speak directly to the extensible priorities spec since I was mostly an observer while the process went through but the end-to-end header intentionally allows for overrides by the origin and it's not immediately clear that the intent wasn't also to allow for the value to be application-specified or at least overridden. That said, it wouldn't hurt for both groups to align on when |
In that case we should probably not set the |
This new header and the lack of control over it in browsers is breaking websites and browser extensions: dessant/buster#405 (comment) |
The At least in the case of Chrome, if the |
To fix this:
cc @domfarolino |
Starting with Firefox 126 we send the header for all requests, and override any user set header: https://phabricator.services.mozilla.com/D201265 |
It doesn't look like web-platform-tests support HTTP/3 which is where it is commonly used. I can create HTTP/1 and HTTP/2 tests which will test one of Chrome's paths but I'm not sure it will work for either Firefox or Safari (as best as I could tell, the change in Firefox 126 is still only setting the header in HTTP/3). |
Would you mind filing an issue requesting HTTP/3 support? I think an issue (might want to reference https://github.com/web-platform-tests/rfcs/blob/master/rfcs/quic.md) and 1/2 coverage is sufficient for now. The Fetch PR will result in implementation bugs being filed which will at least make Gecko and WebKit aware of the problem. |
Oh, hmm, there is https://github.com/web-platform-tests/rfcs/blob/master/rfcs/webtransport_h3_test_server.md as well, but I guess it's currently WebTransport specific? I haven't tried to play with it. An issue is prolly a good next step either way. |
Chrome 124 and Firefox 126 both set the Priority header for HTTP/2 requests, but Safari 17.5 does not. The Priority header implementation in Chrome and Firefox ignores the existence of the request filtering engine available to extensions. Any new HTTP headers you introduce should be set before request filtering, so extensions can have full control over them. If setting the Priority header later on in the network stack is indeed crucial and cannot be done earlier, please reach out to the folks at https://github.com/w3c/webextensions to discuss a solution for having control over such headers. |
@annevk do you have suggestions on how the process flow would look when the value of the I could see something like "If httpRequest’s header list does not contain 'Priority', then user agents may append an appropriate Priority to httpRequest’s header list." but the steps for determining the value to set would require unwinding the browser-specific treatment of internal-priority. Maybe a some text that references the extensible priorities RFC and call it a mapping of internal-priority to the RFC? The timing of the processing might not be appropriate though (as we move towards browser literally implementing the process steps directly) and maybe something like a boolean flag on request that indicates if the |
I think something along those lines seems fine. Probably needs to use "implementation-defined". Since the exact time cannot be observed, the user agent doing it slightly later seems fine and doesn't have to be accounted for. |
No, the Priority header is all requests. You can check by loading https://example.com over H2. |
While working on bug 1900362, we found that we need to include the @annevk , what do you think? |
I think that means you set the header too early. I would not expect the header to show up in |
What is the issue with the Fetch Standard?
The
Priority
request header is part of RFC 9218 (Extensible HTTP Priorities) and sent by the networking layer when appropriate (for most browsers this is when using HTTP/3, Chrome may start sending it for HTTP/2 as well).The header is not currently on the list of forbidden request headers and the behavior is undefined for how it interacts with a user-provided
Priority
header in fetch.For actual prioritization, fetch provides RequestPriority (though it is not as granular) but applications may have their own use for the header name if they are already sending it.
It would be helpful to specify the behavior either by adding it to the forbidden header list or defining how the extensible priorities header should be treated if an application provides an explicit
Priority
header.The current behavior in Firefox is to send both headers. In Chrome (behind a flag) the header will only be set by the networking stack if the application didn't include a
Priority
header as part of the request.The text was updated successfully, but these errors were encountered: