summaryrefslogtreecommitdiff
path: root/cli/tests/unit/tls_test.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-07-25 15:26:18 +0900
committerGitHub <noreply@github.com>2023-07-25 06:26:18 +0000
commit3d3590063954dd30c1ebea02aad136878eeee04e (patch)
tree6bc5fd53d4aa4c0d1d88a715f5e2a019fc9bd64f /cli/tests/unit/tls_test.ts
parente311e46a8f80491bc0ab4bc5dfce55d78bdb7187 (diff)
fix(ext/net): fix string port number handling in listen (#19921)
While string `port` is not allowed in typing, it seems we used to support that and now it's broken. ref: https://github.com/denoland/deno/issues/10064#issuecomment-1637427260 This PR restores the support of string port number in `listen` and `listenTls`
Diffstat (limited to 'cli/tests/unit/tls_test.ts')
-rw-r--r--cli/tests/unit/tls_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts
index 11691379c..1f0702f62 100644
--- a/cli/tests/unit/tls_test.ts
+++ b/cli/tests/unit/tls_test.ts
@@ -1477,3 +1477,17 @@ Deno.test({
}, Deno.errors.AddrInUse);
listener1.close();
});
+
+Deno.test({
+ permissions: { net: true },
+}, function listenTlsDoesNotThrowOnStringPort() {
+ const listener = Deno.listenTls({
+ hostname: "localhost",
+ // @ts-ignore String port is not allowed by typing, but it shouldn't throw
+ // for backwards compatibility.
+ port: "0",
+ cert,
+ key,
+ });
+ listener.close();
+});