summaryrefslogtreecommitdiff
path: root/ext/websocket
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-02-07 13:54:32 +0100
committerGitHub <noreply@github.com>2022-02-07 13:54:32 +0100
commitbf22f114a6e049744866ebaba48faec2cb86549b (patch)
treeea6814e51bade2355144546f21178f54811a57f2 /ext/websocket
parent9c7ed1c98b75c3557ac9e269212dcf655f69c0a2 (diff)
refactor: update runtime code for primordial check for iterators (#13510)
Diffstat (limited to 'ext/websocket')
-rw-r--r--ext/websocket/02_websocketstream.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/websocket/02_websocketstream.js b/ext/websocket/02_websocketstream.js
index 0f4cecaa5..d41dcceef 100644
--- a/ext/websocket/02_websocketstream.js
+++ b/ext/websocket/02_websocketstream.js
@@ -9,6 +9,8 @@
const { writableStreamClose, Deferred } = window.__bootstrap.streams;
const { DOMException } = window.__bootstrap.domException;
const { add, remove } = window.__bootstrap.abortSignal;
+ const { headersFromHeaderList, headerListFromHeaders, fillHeaders } =
+ window.__bootstrap.headers;
const {
ArrayPrototypeJoin,
@@ -121,6 +123,11 @@
);
}
+ const headers = headersFromHeaderList([], "request");
+ if (options.headers !== undefined) {
+ fillHeaders(headers, options.headers);
+ }
+
const cancelRid = core.opSync(
"op_ws_check_permission_and_cancel_handle",
this[_url],
@@ -144,7 +151,7 @@
? ArrayPrototypeJoin(options.protocols, ", ")
: "",
cancelHandle: cancelRid,
- headers: [...new Headers(options.headers).entries()],
+ headers: headerListFromHeaders(headers),
}),
(create) => {
options.signal?.[remove](abort);