From 526596254d9554de67dc78b296abe57765cb51fc Mon Sep 17 00:00:00 2001 From: frankpagan Date: Tue, 7 Nov 2023 17:39:30 -0600 Subject: [PATCH] fix: url bug --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 0997716..4e4fa0a 100644 --- a/src/index.js +++ b/src/index.js @@ -57,8 +57,10 @@ class SocketServer extends EventEmitter { socket.socketUrl = socket.origin + socket.pathname if (socket.origin && socket.origin !== 'null') { - const url = new URL(socket.origin); - socket.host = url.host || socket.origin; + if (socket.origin.includes('://')) + socket.host = new URL(socket.origin).host + else + socket.host = socket.origin; } if (!organization || organization && organization.status !== false) {