Skip to content

Commit

Permalink
enable another case
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Oct 3, 2024
1 parent cf6ae67 commit 8714e71
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
24 changes: 14 additions & 10 deletions ext/node/polyfills/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,16 +703,20 @@ function _lookupAndConnect(
} else {
self._unrefTimer();

defaultTriggerAsyncIdScope(
self[asyncIdSymbol],
_internalConnect,
self,
ip,
port,
addressType,
localAddress,
localPort,
);
defaultTriggerAsyncIdScope(self[asyncIdSymbol], nextTick, () => {
if (self.connecting) {
defaultTriggerAsyncIdScope(
self[asyncIdSymbol],
_internalConnect,
self,
ip,
port,
addressType,
localAddress,
localPort,
);
}
});
}
},
);
Expand Down
40 changes: 17 additions & 23 deletions tests/unit_node/http_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1074,30 +1074,24 @@ Deno.test("[node/https] node:https exports globalAgent", async () => {
);
});

Deno.test(
"[node/http] node:http request.setHeader(header, null) doesn't throw",
Deno.test("[node/http] node:http request.setHeader(header, null) doesn't throw", () => {
{
ignore: true,
},
() => {
{
const req = http.request("http://localhost:4545/");
req.on("error", () => {});
// @ts-expect-error - null is not a valid header value
req.setHeader("foo", null);
req.end();
req.destroy();
}
{
const req = https.request("https://localhost:4545/");
req.on("error", () => {});
// @ts-expect-error - null is not a valid header value
req.setHeader("foo", null);
req.end();
req.destroy();
}
},
);
const req = http.request("http://localhost:4545/");
req.on("error", () => {});
// @ts-expect-error - null is not a valid header value
req.setHeader("foo", null);
req.end();
req.destroy();
}
{
const req = https.request("https://localhost:4545/");
req.on("error", () => {});
// @ts-expect-error - null is not a valid header value
req.setHeader("foo", null);
req.end();
req.destroy();
}
});

Deno.test("[node/http] ServerResponse getHeader", async () => {
const { promise, resolve } = Promise.withResolvers<void>();
Expand Down

0 comments on commit 8714e71

Please sign in to comment.