-
Notifications
You must be signed in to change notification settings - Fork 312
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
should sec-ch-ua headers be visible in FetchEvent.request.headers #1525
Comments
This affects fetch-request-xhr.https.html WPT test. |
Is the content of these headers defined anywhere? It isn't clear what they contain. Is there a security reason to prevent them being visible in the service worker? I think the Do we know what behaviour they want? |
@yoavweiss can hopefully answer that. |
https://wicg.github.io/ua-client-hints/
For other client hints (which may vary over time), it seems critical for the Service Worker to see the hints so that it can respond with the right variant. |
/cc @amtunlimited |
There's a set of low-level problem with these headers that hasn't been resolved, e.g., whatwg/fetch#1000. There's also whatwg/fetch#726 from 2018 without many updates. |
@annevk can you remember why the user agent header is added so late in fetch? |
That's how implementations did it and I don't think we considered changing that when adding service workers. |
Currently the spec requires that user-agent header be set after the service worker fetch handler, so the user-agent header is not visible on
FetchEvent.request
.Client hints headers in general, however, are added prior to service worker processing:
https://wicg.github.io/client-hints-infrastructure/#fetch
This results in the new sec-ch-ua headers appearing on
FetchEvent.request
which seems inconsistent with not exposing user-agent.What do folks think we should do here? Accept the difference between sec-ch-ua and user-agent? Align sec-ch-ua with current user-agent behavior?
@annevk @jakearchibald @youennf
The text was updated successfully, but these errors were encountered: