`emulation.setLocaleOverride` does not override `Accept-Language` header for in `Worker` for `fetch` and `WebSocket`
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Tracking
(firefox154 fixed)
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: hi, Assigned: hi)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m21][webdriver:external], [wptsync upstream])
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0
Steps to reproduce:
- navigate a top-level context to a page
emulation.setLocaleOverride { locale: "de-DE", contexts: [<context>] }- in the page, create a
Workerwith one/both of:fetch("/echo-accept-language")new WebSocket("ws://.../echo")
- for comparison, issue the same
fetchandWebSocketfrom thedocumentitself
Actual results:
document fetch and WebSocket handshake have Accept-Language: de-DE
Worker fetch and WebSocket have default Accept-Language
Expected results:
Worker fetch and WebSocket handshakes send Accept-Language: de-DE, matching document requests and matching the JS locale that bug 2015655 already emulates in Worker
| Assignee | ||
Updated•9 days ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
Bug 1995691 made emulation.setLocaleOverride override the Accept-Language request header, but only for document-initiated requests.
Bug 2015655 made the locale override apply to the JS realm and navigator.language in Worker and SharedWorker but it did not touch the Accept-Language header or WebSocket path.
HttpBaseChannel::Init builds Accept-Language from mLoadInfo->GetBrowsingContext()->Top()->GetLanguageOverride().
For Worker requests GetBrowsingContext() is null, and the code never consults GetAssociatedBrowsingContext(), which fetch() already populates on the channel's LoadInfo.
Worker WebSocket handshakes are additionally missing that association as the channel's LoadInfo never gets associatedBrowsingContextID set at all.
Updated•9 days ago
|
Updated•3 days ago
|
Updated•2 days ago
|
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61276 for changes under testing/web-platform/tests
Comment 4•1 day ago
|
||
| bugherder | ||
Upstream PR merged by moz-wptsync-bot
Description
•