mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-03-13 14:59:23 +01:00
feat(connectivity): change query parameter to change connectivity
Always use timestamp as query parameter instead of alive
This commit is contained in:
parent
4353f5e036
commit
f64278d41d
@ -56,7 +56,8 @@ export default {
|
|||||||
|
|
||||||
// extra check to make sure we're not offline
|
// extra check to make sure we're not offline
|
||||||
let that = this;
|
let that = this;
|
||||||
return fetch(window.location.href + "?alive", {
|
const aliveCheckUrl = window.location.href + "?t="+(new Date().valueOf());
|
||||||
|
return fetch(aliveCheckUrl, {
|
||||||
method: "HEAD",
|
method: "HEAD",
|
||||||
cache: "no-store",
|
cache: "no-store",
|
||||||
redirect: "manual"
|
redirect: "manual"
|
||||||
@ -64,7 +65,7 @@ export default {
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
// opaqueredirect means request has been redirected, to auth provider probably
|
// opaqueredirect means request has been redirected, to auth provider probably
|
||||||
if ((response.type === "opaqueredirect" && !response.ok) || [401, 403].indexOf(response.status) != -1) {
|
if ((response.type === "opaqueredirect" && !response.ok) || [401, 403].indexOf(response.status) != -1) {
|
||||||
window.location.href = window.location.href + "?t="+(new Date().valueOf());
|
window.location.href = aliveCheckUrl;
|
||||||
}
|
}
|
||||||
that.offline = !response.ok;
|
that.offline = !response.ok;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user