mirror of https://github.com/vector-im/riot-web
Fix local jitsi build url fail and missing argument
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
0212e96938
commit
ca02ff493c
|
@ -435,7 +435,7 @@ async function _startCallApp(roomId, type) {
|
|||
const confId = room.roomId.replace(/[^A-Za-z0-9]/g, '') + widgetSessionId;
|
||||
const jitsiDomain = SdkConfig.get()['jitsi']['preferredDomain'];
|
||||
|
||||
const widgetUrl = WidgetUtils.getLocalJitsiWrapperUrl();
|
||||
const widgetUrl = WidgetUtils.getLocalJitsiWrapperUrl({});
|
||||
|
||||
const widgetData = {
|
||||
widgetSessionId, // TODO: Remove this eventually
|
||||
|
|
|
@ -485,19 +485,16 @@ export default class WidgetUtils {
|
|||
'userId=$matrix_user_id',
|
||||
].join('&');
|
||||
|
||||
let currentUrl = window.location.href.split('#')[0];
|
||||
if (!currentUrl.startsWith("https://") && !opts.forLocalRender) {
|
||||
let baseUrl = window.location;
|
||||
if (window.location.protocol !== "https:" && !opts.forLocalRender) {
|
||||
// Use an external wrapper if we're not locally rendering the widget. This is usually
|
||||
// the URL that will end up in the widget event, so we want to make sure it's relatively
|
||||
// safe to send.
|
||||
// We'll end up using a local render URL when we see a Jitsi widget anyways, so this is
|
||||
// really just for backwards compatibility and to appease the spec.
|
||||
currentUrl = "https://riot.im/app";
|
||||
baseUrl = "https://riot.im/app";
|
||||
}
|
||||
if (!currentUrl.endsWith('/')) {
|
||||
currentUrl = `${currentUrl}/`;
|
||||
}
|
||||
|
||||
return currentUrl + "jitsi.html#" + queryString;
|
||||
const url = new URL("jitsi.html#" + queryString, baseUrl); // this strips hash fragment from baseUrl
|
||||
return url.href;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue