1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

fix(node/http): add setKeepAlive to FakeSocket (#19659)

Closes #19535
This commit is contained in:
Leo Kettmeir 2023-06-30 03:39:16 +02:00 committed by GitHub
parent 13a45ae994
commit 4db534d461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -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();

View file

@ -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 */