From b683df09ffe31c2f58b3be92e9f1b3a9d1625ef7 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 29 Sep 2022 22:20:57 -0700 Subject: [PATCH] Simplify window.location references --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7d733ac..cf56544 100644 --- a/index.html +++ b/index.html @@ -140,7 +140,7 @@ if (!match) { // MUST redirect to a page where the web server serves an actual 404 error (i.e. not just // index.html again) otherwise this triggers an infinite loop - window.location.href = `${window.location.protocol}//${window.location.host}/errors/NotFound`; + window.location.href = `${window.location.origin}/errors/NotFound`; } } @@ -151,7 +151,7 @@ return; } - const base = new URL(`${window.location.protocol}//${window.location.host}`); + const base = new URL(`${window.location.origin}`); const url = new URL(path, base); window.history.pushState({}, '', url); -- 2.47.3