Skip to content

Commit 37107a7

Browse files
authored
Update web_socket_server.ts
1 parent aba24ce commit 37107a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web_socket_server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ export function WebSocketServer(options : Deno.ServeOptions | Deno.ServeTlsOptio
55
if (request.headers.get("upgrade") != "websocket") {
66
return new Response(null, { status: 501 });
77
}
8+
9+
// Needed because of a bug: https://github.com/denoland/deno/issues/19471
10+
const req = Object.assign({}, request)
11+
812
const {socket, response} = Deno.upgradeWebSocket(request)
913

10-
handler(socket, request)
14+
handler(socket, req);
1115

1216
return response
1317
})

0 commit comments

Comments
 (0)