Skip to content

Commit

Permalink
fix: url bug
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Nov 7, 2023
1 parent 35a7724 commit 5265962
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5265962

Please sign in to comment.