diff options
-rw-r--r-- | cli/tests/unit_node/http_test.ts | 3 | ||||
-rw-r--r-- | ext/node/polyfills/http.ts | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 2a2203e05..2dbada770 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -350,6 +350,9 @@ Deno.test("[node/http] send request with non-chunked body", async () => { assertEquals(requestHeaders.has("transfer-encoding"), false); assertEquals(requestBody, "hello world"); }); + req.on("socket", (socket) => { + socket.setKeepAlive(); + }); req.write("hello "); req.write("world"); req.end(); diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 28592437e..f651b1f50 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -274,6 +274,7 @@ const kError = Symbol("kError"); const kUniqueHeaders = Symbol("kUniqueHeaders"); class FakeSocket extends EventEmitter { + setKeepAlive() {} } /** ClientRequest represents the http(s) request from the client */ |