]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Fix ConnectivityChecker to evaluate the response status codes. 186/head
authorpdevq <45507854+pdevq@users.noreply.github.com>
Sat, 30 Jan 2021 05:17:24 +0000 (00:17 -0500)
committerpdevq <45507854+pdevq@users.noreply.github.com>
Sat, 30 Jan 2021 05:17:24 +0000 (00:17 -0500)
src/components/ConnectivityChecker.vue

index d41c4437442e46256749f2230d1fa3755892ab5f..7302e1f56a5ea91504c62e506736b3337a3aa752 100644 (file)
@@ -37,8 +37,12 @@ export default {
         method: "HEAD",
         cache: "no-store",
       })
-        .then(function () {
-          that.offline = false;
+        .then(function (response) {
+          if (response.status >= 200 && response.status < 300) {
+            that.offline = false;
+          } else {
+            that.offline = true;
+          }
         })
         .catch(function () {
           that.offline = true;