diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-01-18 22:24:02 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 22:24:02 +0530 |
commit | 66ff28c21eac7f0cca0d3ccf141b1dc4cafa4888 (patch) | |
tree | d30535b5717276d5f276e974c0f1a7f366f24b12 /cli/tests/unit_node/http_test.ts | |
parent | 2141543105dd9aabc0aca0534abc837f114e5bac (diff) |
fix(node): update `req.socket` on WS upgrade (#21984)
Update the `req.socket` to be a `net.Socket` from `FakeSocket`
Fixes #21979
Diffstat (limited to 'cli/tests/unit_node/http_test.ts')
-rw-r--r-- | cli/tests/unit_node/http_test.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 91e2f5703..3573416f8 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -716,7 +716,9 @@ Deno.test( }); // @ts-ignore it's a socket for real let serverSocket; - server.on("upgrade", (_req, socket, _head) => { + server.on("upgrade", (req, socket, _head) => { + // https://github.com/denoland/deno/issues/21979 + assert(req.socket?.write); socket.write( "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" + "Upgrade: WebSocket\r\n" + |