Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(util) fix parsing strings in parseURLParams

Saúl Ibarra Corretgé2c5b13248310
diff --git a/react/features/base/util/parseURLParams.js b/react/features/base/util/parseURLParams.js
index 56f1fb4ac8..11494e4056 100644
--- a/react/features/base/util/parseURLParams.js
+++ b/react/features/base/util/parseURLParams.js
@@ -23,9 +23,13 @@ const blacklist = [ '__proto__', 'constructor', 'prototype' ];
* @returns {Object}
*/
export function parseURLParams(
- url: URL,
+ url: URL | string,
dontParse: boolean = false,
source: string = 'hash'): Object {
+ if (typeof url === 'string') {
+ // eslint-disable-next-line no-param-reassign
+ url = new URL(url);
+ }
const paramStr = source === 'search' ? url.search : url.hash;
const params = {};
const paramParts = (paramStr && paramStr.substr(1).split('&')) || [];