From adf2e60d54757815855e8b032b089d2b08314c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 31 Mar 2021 17:50:27 +0200 Subject: [PATCH] Fixing issue with double slash in websocket URL --- front/src/Connexion/RoomConnection.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front/src/Connexion/RoomConnection.ts b/front/src/Connexion/RoomConnection.ts index 199e8f6a..9efd5433 100644 --- a/front/src/Connexion/RoomConnection.ts +++ b/front/src/Connexion/RoomConnection.ts @@ -69,7 +69,10 @@ export class RoomConnection implements RoomConnection { public constructor(token: string|null, roomId: string, name: string, characterLayers: string[], position: PositionInterface, viewport: ViewportInterface) { let url = new URL(PUSHER_URL, window.location.toString()).toString(); url = url.replace('http://', 'ws://').replace('https://', 'wss://'); - url += '/room'; + if (!url.endsWith('/')) { + url += '/'; + } + url += 'room'; url += '?roomId='+(roomId ?encodeURIComponent(roomId):''); url += '&token='+(token ?encodeURIComponent(token):''); url += '&name='+encodeURIComponent(name);