From a8a34ea756a40c313883fe23c12022b1c1e66ca7 Mon Sep 17 00:00:00 2001 From: AndrewFerr Date: Mon, 22 Nov 2021 20:34:55 -0500 Subject: [PATCH] Remove leading slash from /addwidget Jitsi confs (#7175) * Remove leading slash from /addwidget Jitsi confs Fixes https://github.com/vector-im/element-web/issues/19839 Signed-off-by: Andrew Ferrazzutti * Make requested changes Signed-off-by: Andrew Ferrazzutti --- src/widgets/Jitsi.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/Jitsi.ts b/src/widgets/Jitsi.ts index cd31e57d7c..006fbbdc58 100644 --- a/src/widgets/Jitsi.ts +++ b/src/widgets/Jitsi.ts @@ -92,7 +92,9 @@ export class Jitsi { const parsed = new URL(url); if (parsed.hostname !== this.preferredDomain) return null; // invalid return { - conferenceId: parsed.pathname, + // URL pathnames always contain a leading slash. + // Remove it to be left with just the conference name. + conferenceId: parsed.pathname.substring(1), domain: parsed.hostname, isAudioOnly: false, };