diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-18 21:14:02 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-20 21:10:04 +0100 |
| commit | a98967301e83e3301e5fd04b6c31ff76da2e96b4 (patch) | |
| tree | f7150dbcc4e3967981624917a8e234d2dd6759d8 /webAO | |
| parent | 576d1d2e6b593a89ab5339b94e57ab1b1044db28 (diff) | |
Use current host in https redirect instead of hardcoding
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/master.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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]; |
