aboutsummaryrefslogtreecommitdiff
path: root/src/js/node
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-09-08 16:27:44 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-08 16:27:44 -0700
commitffe4f561a3af53b9f5a41c182de55d7199b5d692 (patch)
tree5ecf85239c16ab22e790b1c85bcdf0961c01f9a9 /src/js/node
parentc896792c37574b745f5b2a05e2f7d20aa4cdd9ac (diff)
downloadbun-ffe4f561a3af53b9f5a41c182de55d7199b5d692.tar.gz
bun-ffe4f561a3af53b9f5a41c182de55d7199b5d692.tar.zst
bun-ffe4f561a3af53b9f5a41c182de55d7199b5d692.zip
Fix listen() using unix socket if argument is a valid port (#4620)
* Fix listen() using unix socket if argument is a valid port Fixes #4582 * Add test
Diffstat (limited to 'src/js/node')
-rw-r--r--src/js/node/http.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/node/http.ts b/src/js/node/http.ts
index 8d457bb85..70ee6cead 100644
--- a/src/js/node/http.ts
+++ b/src/js/node/http.ts
@@ -449,7 +449,7 @@ class Server extends EventEmitter {
listen(port, host, backlog, onListen) {
const server = this;
let socketPath;
- if (typeof port == "string") {
+ if (typeof port == "string" && !Number.isSafeInteger(Number(port))) {
socketPath = port;
}
if (typeof host === "function") {