From b098b5f37d88023604e8cc270906eea64ad1ef61 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Tue, 30 Nov 2021 17:29:53 +0100 Subject: [PATCH] Fixing "Query string parameters prevent WA from loading" Due to a regression, query string parameters added to the URL (like: http://play.workadventure.localhost/_/global/maps.workadventure.localhost/starter/map.json?utm_source=sendinblue&utm_campaign=WA+-+2021+Christmap+map+launch&utm_medium=email#foo ) were causing a crash in WA. Signed-off-by: Gregoire Parant --- front/src/Connexion/ConnectionManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/src/Connexion/ConnectionManager.ts b/front/src/Connexion/ConnectionManager.ts index b75c6bc6..af128028 100644 --- a/front/src/Connexion/ConnectionManager.ts +++ b/front/src/Connexion/ConnectionManager.ts @@ -132,13 +132,14 @@ class ConnectionManager { const roomUrl = data.roomUrl; + const query = urlParams.toString(); this._currentRoom = await Room.createRoom( new URL( window.location.protocol + "//" + window.location.host + roomUrl + - urlParams.toString() + //use urlParams because the token param must be deleted + (query ? "?" + query : "") + //use urlParams because the token param must be deleted window.location.hash ) );