Merge pull request #186 from pdevq/connectivity_checker_status

Fix ConnectivityChecker to evaluate the response status codes
This commit is contained in:
Bastien Wirtz 2021-07-14 07:37:53 -07:00 committed by GitHub
commit a6b7db5437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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