From bd5dcb7512fb8e7e1bdc7f54dcce099889afb560 Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Sun, 24 Sep 2023 09:14:49 +0300 Subject: [PATCH] Don't fall back to relative address when using proxy-https Affects issues: - Fixed #3032 --- .../dashboard/src/service/backendConfiguration.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Plan/react/dashboard/src/service/backendConfiguration.js b/Plan/react/dashboard/src/service/backendConfiguration.js index 2f7bebd07..8c40af106 100644 --- a/Plan/react/dashboard/src/service/backendConfiguration.js +++ b/Plan/react/dashboard/src/service/backendConfiguration.js @@ -6,8 +6,14 @@ const javaReplaced = { } const isCurrentAddress = (address) => { - const 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.`) + let is = window.location.href.startsWith(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; }