feat(ext/websocket): add header support to WebSocketStream (#11887)

This commit is contained in:
Leo Kettmeir 2022-01-05 17:41:44 +01:00 committed by GitHub
parent c74eb7a889
commit c40419b55b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 92 additions and 0 deletions

View file

@ -39,6 +39,10 @@
key: "signal",
converter: webidl.converters.AbortSignal,
},
{
key: "headers",
converter: webidl.converters.HeadersInit,
},
],
);
webidl.converters.WebSocketCloseInfo = webidl.createDictionaryConverter(
@ -139,6 +143,7 @@
? ArrayPrototypeJoin(options.protocols, ", ")
: "",
cancelHandle: cancelRid,
headers: [...new Headers(options.headers).entries()],
}),
(create) => {
options.signal?.[remove](abort);