summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/http.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-01-18 22:24:02 +0530
committerGitHub <noreply@github.com>2024-01-18 22:24:02 +0530
commit66ff28c21eac7f0cca0d3ccf141b1dc4cafa4888 (patch)
treed30535b5717276d5f276e974c0f1a7f366f24b12 /ext/node/polyfills/http.ts
parent2141543105dd9aabc0aca0534abc837f114e5bac (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 'ext/node/polyfills/http.ts')
-rw-r--r--ext/node/polyfills/http.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index fe5896534..9356dde0a 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -1637,6 +1637,8 @@ export class ServerImpl extends EventEmitter {
const socket = new Socket({
handle: new TCP(constants.SERVER, conn),
});
+ // Update socket held by `req`.
+ req.socket = socket;
this.emit("upgrade", req, socket, Buffer.from([]));
return response;
} else {