aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-06-05 21:48:10 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2022-07-02 21:18:29 +0200
commitc80854cb2d1e4ee0f96e8e5185b466b6c06c5416 (patch)
tree9d7225b5739fcfdc5b324ede09a3e0a111a7e5e7
parentcbbed6346a437e6b9f05f646f1df0c77d2fb36eb (diff)
downloadhomer-c80854cb2d1e4ee0f96e8e5185b466b6c06c5416.tar.gz
homer-c80854cb2d1e4ee0f96e8e5185b466b6c06c5416.tar.zst
homer-c80854cb2d1e4ee0f96e8e5185b466b6c06c5416.zip
Make connectivity check work with vitejs dev server
Head requests on directory path end up in 404
-rw-r--r--index.html5
-rw-r--r--src/components/ConnectivityChecker.vue2
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 @@
3 <head> 3 <head>
4 <meta charset="UTF-8" /> 4 <meta charset="UTF-8" />
5 <link rel="icon" href="/favicon.ico" /> 5 <link rel="icon" href="/favicon.ico" />
6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 <meta name="viewport" content="width=device-width,initial-scale=1.0,viewport-fit=cover">
7 <title>Vite App</title> 7 <meta name="robots" content="noindex">
8 <title>Homer</title>
8 </head> 9 </head>
9 <body> 10 <body>
10 <div id="app"></div> 11 <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 {
56 56
57 // extra check to make sure we're not offline 57 // extra check to make sure we're not offline
58 let that = this; 58 let that = this;
59 const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf(); 59 const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`;
60 return fetch(aliveCheckUrl, { 60 return fetch(aliveCheckUrl, {
61 method: "HEAD", 61 method: "HEAD",
62 cache: "no-store", 62 cache: "no-store",