Implement the headers option of the WebTransport constructor
Categories
(Core :: Networking, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: jesup, Assigned: jesup)
References
(Depends on 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [necko-triaged])
Attachments
(1 external file)
The WebTransport spec added a headers member to WebTransportOptions (w3c/webtransport PR 713, merged 2026-02-25, fixing issue 263), so pages can add headers to the CONNECT request. Firefox does not implement it: WebTransportOptions in WebTransport.webidl has no headers member, so the option is silently ignored.
Spec requirements (WebTransport constructor, steps 30-33):
headersis aHeadersInit, defaulting to{}. It is converted to aHeadersobject, so invalid names or values throw aTypeError.- If the ASCII-lowercased name of any header is
wt-available-protocols, throw aTypeError. - Headers are appended to the request through a
Headersobject with the "request" guard, so Fetch's forbidden request-header names (for exampleCookie,Host,Referer,Sec-Fetch-*) are dropped silently rather than throwing. - If
protocolsis non-empty,WT-Available-Protocolsis set afterwards fromprotocols, so it can only be sent that way.
Gecko currently builds the CONNECT request in WebTransportSessionProxy, where protocols is turned into wt-available-protocols through SetRequestHeader(). The new option needs:
- the
headersmember inWebTransportOptions, with validation inWebTransport::Constructor(TypeErrorcases and the forbidden-name filtering); - a way to carry the resulting header list to the parent process (a new argument on the
PWebTransportconstructor message,WebTransportParent, andnsIWebTransport.asyncConnect); - setting those headers on the channel in
WebTransportSessionProxy, beforewt-available-protocols.
The headers must also reach the server over HTTP/2 as well as HTTP/3, in lowercase.
Tests: webtransport/headers.https.any.js already covers this.
| Assignee | ||
Comment 1•1 month ago
|
||
Add headers to WebTransportOptions. It is filled into a Headers object, wt-available-protocols is rejected with a TypeError, and the rest goes through a request-guard Headers so forbidden request-header names are dropped silently. The resulting list travels to the parent over CreateWebTransportParent and is set on the CONNECT channel before wt-available-protocols. The parent applies the same restrictions again since the content process is not trusted.
Remove the now-passing expectations from headers.https.any.js.ini.
Updated•1 month ago
|
Updated•1 month ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•23 days ago
|
Comment 4•17 days ago
|
||
FF160 MDN work for this can be tracked in https://github.com/mdn/content/issues/46284
Description
•