diff options
author | 2023-09-08 16:27:44 -0700 | |
---|---|---|
committer | 2023-09-08 16:27:44 -0700 | |
commit | ffe4f561a3af53b9f5a41c182de55d7199b5d692 (patch) | |
tree | 5ecf85239c16ab22e790b1c85bcdf0961c01f9a9 /src/js/node | |
parent | c896792c37574b745f5b2a05e2f7d20aa4cdd9ac (diff) | |
download | bun-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.ts | 2 |
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") { |