From c80854cb2d1e4ee0f96e8e5185b466b6c06c5416 Mon Sep 17 00:00:00 2001
From: Bastien Wirtz <bastien.wirtz@gmail.com>
Date: Sun, 5 Jun 2022 21:48:10 +0200
Subject: [PATCH] Make connectivity check work with vitejs dev server

Head requests on directory path end up in 404
---
 index.html                             | 5 +++--
 src/components/ConnectivityChecker.vue | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.html b/index.html
index 030a6ff..d6f51df 100644
--- a/index.html
+++ b/index.html
@@ -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>
diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue
index 2b3e47b..3066b7d 100644
--- a/src/components/ConnectivityChecker.vue
+++ b/src/components/ConnectivityChecker.vue
@@ -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",