Don't fall back to relative address when using proxy-https

Affects issues:
- Fixed #3032
This commit is contained in:
Aurora Lahtela 2023-09-24 09:14:49 +03:00
parent 9bf7d65137
commit bd5dcb7512

View File

@ -6,8 +6,14 @@ const javaReplaced = {
} }
const isCurrentAddress = (address) => { const isCurrentAddress = (address) => {
const is = window.location.href.startsWith(address); let is = window.location.href.startsWith(address);
if (!is) console.warn(`Configured address ${address} did not match start of ${window.location.href}, falling back to relative address. Configure 'Webserver.Alternative_IP' settings to point to your address.`) const usingProxyHttps = window.location.href.startsWith("https") && address.startsWith("http");
if (usingProxyHttps) {
is = window.location.href.replace('https', '').startsWith(address.replace('http'));
}
if (!is) {
console.warn(`Configured address ${address} did not match start of ${window.location.href}, falling back to relative address. Configure 'Webserver.Alternative_IP' settings to point to your address.`)
}
return is; return is;
} }