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 <fair@miscworks.net>

* Make requested changes

Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
pull/21833/head
AndrewFerr 2021-11-22 20:34:55 -05:00 committed by GitHub
parent 925136d016
commit a8a34ea756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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,
};