summaryrefslogtreecommitdiff
path: root/tests/unit_node/net_test.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2024-09-05 14:13:06 +0900
committerGitHub <noreply@github.com>2024-09-05 14:13:06 +0900
commite799c2857c81f7656811aaf6a248432fe88e8169 (patch)
tree98d91c90b9020251b71e4d12dc2bf8618e02599c /tests/unit_node/net_test.ts
parent186f7484da3116aeda474f7f529d417ee542b450 (diff)
fix(ext/http): do not set localhost to hostname unnecessarily (#24777)
This commit changes when to cause the hostname substition of `0.0.0.0` -> `localhost`. Currently we substitute `localhost` to the hostname on windows before calling `options.onListen`, which prevents the users to do more advanced thing using hostname string like https://github.com/denoland/std/issues/5558. This PR changes it not to substitute it when the user provide `onListen` callback. closes #24776 unblocks https://github.com/denoland/std/issues/5558
Diffstat (limited to 'tests/unit_node/net_test.ts')
-rw-r--r--tests/unit_node/net_test.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/unit_node/net_test.ts b/tests/unit_node/net_test.ts
index f49ff0ef0..708d06386 100644
--- a/tests/unit_node/net_test.ts
+++ b/tests/unit_node/net_test.ts
@@ -79,6 +79,7 @@ Deno.test("[node/net] net.connect().unref() works", async () => {
port: 0, // any available port will do
handler: () => new Response("hello"),
onListen: async ({ port, hostname }) => {
+ hostname = Deno.build.os === "windows" ? "localhost" : hostname;
const { stdout, stderr } = await new Deno.Command(Deno.execPath(), {
args: [
"eval",