]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Make connectivity check work with vitejs dev server
authorBastien Wirtz <bastien.wirtz@gmail.com>
Sun, 5 Jun 2022 19:48:10 +0000 (21:48 +0200)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Sat, 2 Jul 2022 19:18:29 +0000 (21:18 +0200)
Head requests on directory path end up in 404

index.html
src/components/ConnectivityChecker.vue

index 030a6ff51bfc6f6adcc472f6d8c02db92ce947a8..d6f51df168fb70116c6a02918d0161770a5349a2 100644 (file)
@@ -3,8 +3,9 @@
   <head>
     <meta charset="UTF-8" />
     <link rel="icon" href="/favicon.ico" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite App</title>
+    <meta name="viewport" content="width=device-width,initial-scale=1.0,viewport-fit=cover">
+    <meta name="robots" content="noindex">
+    <title>Homer</title>
   </head>
   <body>
     <div id="app"></div>
index 2b3e47b243adba523f5ade47f86cb2cf53d519b4..3066b7d6c5ae384bc2753f79781d5fc4864c1d2a 100644 (file)
@@ -56,7 +56,7 @@ export default {
 
       // extra check to make sure we're not offline
       let that = this;
-      const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf();
+      const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`;
       return fetch(aliveCheckUrl, {
         method: "HEAD",
         cache: "no-store",