summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/unit_node/http_test.ts2
-rw-r--r--ext/node/polyfills/http.ts2
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 62cfe59a8..a361ff257 100644
--- a/cli/tests/unit_node/http_test.ts
+++ b/cli/tests/unit_node/http_test.ts
@@ -352,6 +352,8 @@ Deno.test("[node/http] send request with non-chunked body", async () => {
assertEquals(requestBody, "hello world");
});
req.on("socket", (socket) => {
+ assert(socket.writable);
+ assert(socket.readable);
socket.setKeepAlive();
socket.destroy();
});
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index bba11cdc1..b34c45f9c 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -279,6 +279,8 @@ class FakeSocket extends EventEmitter {
this.remoteAddress = opts.hostname;
this.remotePort = opts.port;
this.encrypted = opts.encrypted;
+ this.writable = true;
+ this.readable = true;
}
setKeepAlive() {}