Merge pull request #1607 from thecodingmachine/fix_query_string

Fixing "Query string parameters prevent WA from loading"
This commit is contained in:
David Négrier 2021-11-30 14:48:15 +01:00 committed by GitHub
commit 986f826830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -163,12 +163,13 @@ class ConnectionManager {
console.error(err); console.error(err);
} }
} else { } else {
const query = urlParams.toString();
roomPath = roomPath =
window.location.protocol + window.location.protocol +
"//" + "//" +
window.location.host + window.location.host +
window.location.pathname + window.location.pathname +
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; window.location.hash;
} }

View File

@ -4,8 +4,9 @@ const fs = require('fs')
import { Selector } from 'testcafe'; import { Selector } from 'testcafe';
import {userAlice} from "./utils/roles"; import {userAlice} from "./utils/roles";
// Note: we are also testing that we can connect if the URL contains a random query string
fixture `Variables` fixture `Variables`
.page `http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Variables/Cache/variables_tmp.json`; .page `http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Variables/Cache/variables_tmp.json?somerandomparam=1`;
test("Test that variables cache in the back don't prevent setting a variable in case the map changes", async (t: TestController) => { test("Test that variables cache in the back don't prevent setting a variable in case the map changes", async (t: TestController) => {
// Let's start by visiting a map that DOES not have the variable. // Let's start by visiting a map that DOES not have the variable.