From c1d05cf623694262c20449a98103ee3ee02eea40 Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Fri, 27 Jan 2023 18:33:53 -0300 Subject: fix(Express.js) Express.js try to use function as hostname (#1914) --- src/bun.js/http.exports.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/bun.js/http.exports.js') diff --git a/src/bun.js/http.exports.js b/src/bun.js/http.exports.js index 1655fa09d..dd3745b30 100644 --- a/src/bun.js/http.exports.js +++ b/src/bun.js/http.exports.js @@ -43,13 +43,12 @@ export class Server extends EventEmitter { const server = this; if (typeof host === "function") { onListen = host; + host = undefined; } if (typeof port === "function") { onListen = port; - } - - if (typeof port === "object") { + } else if (typeof port === "object") { host = port?.host; port = port?.port; if (typeof port?.callback === "function") onListen = port?.callback; -- cgit v1.2.3