]> git.ardis.lu - ardislu.dev/commitdiff
Simplify string
authorArdis Lu <ardisglu@gmail.com>
Tue, 2 Aug 2022 07:15:57 +0000 (00:15 -0700)
committerArdis Lu <ardisglu@gmail.com>
Tue, 2 Aug 2022 07:15:57 +0000 (00:15 -0700)
script.js

index ba983e44025aeaa90e6a34068926503d8dcb8c31..85b95b0df6269df050c8a29733047d560d960c55 100644 (file)
--- a/script.js
+++ b/script.js
@@ -170,7 +170,7 @@ async function showPage(path) {
     // 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
     document.title = '404: Not Found';
-    location.replace(`${location.protocol}//${location.host}/errors/NotFound`);
+    location.replace(`${location.origin}/errors/NotFound`);
   }
 }
 
This page took 0.042465 seconds and 4 git commands to generate.