From a98967301e83e3301e5fd04b6c31ff76da2e96b4 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Sat, 18 Nov 2023 21:14:02 +0100 Subject: Use current host in https redirect instead of hardcoding --- webAO/master.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webAO') diff --git a/webAO/master.ts b/webAO/master.ts index a09d111..4c2175c 100644 --- a/webAO/master.ts +++ b/webAO/master.ts @@ -25,6 +25,7 @@ const clientVersion = process.env.npm_package_version; // const MASTERSERVER_IP = 'master.aceattorneyonline.com:27014'; const serverlist_domain = 'servers.aceattorneyonline.com'; const protocol = window.location.protocol; +const host = window.location.host; const serverlist_cache_key = 'masterlist'; @@ -77,7 +78,7 @@ fpPromise export function check_https() { if (protocol === 'https:') { document.getElementById('https_error').style.display = ''; - setTimeout(() => window.location.replace("http://web.aceattorneyonline.com/"), 5000); + setTimeout(() => window.location.replace(`http://${host}/`), 5000); } } @@ -210,7 +211,6 @@ function getCachedServerlist(): AOServer[] { } function processServerlist(serverlist: AOServer[]) { - const host = window.location.host; const clientURL: string = `${protocol}//${host}/client.html`; for (let i = 0; i < serverlist.length - 1; i++) { const server = serverlist[i]; -- cgit