Skip to content

Commit

Permalink
fix(node/http): add setKeepAlive to FakeSocket (denoland#19659)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Jun 30, 2023
1 parent 13a45ae commit 4db534d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/tests/unit_node/http_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions ext/node/polyfills/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4db534d

Please sign in to comment.