mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-26 04:49:13 -05:00
Merge pull request #2163 from TotallyNotElite/master
Prevent reverse proxy 5xx codes from triggering a page reload
This commit is contained in:
commit
a12fba0d98
@ -1076,7 +1076,9 @@
|
|||||||
if (!xdr) xdr = new XMLHttpRequest();
|
if (!xdr) xdr = new XMLHttpRequest();
|
||||||
xdr.open('HEAD', window.location.href);
|
xdr.open('HEAD', window.location.href);
|
||||||
xdr.timeout = 15000;
|
xdr.timeout = 15000;
|
||||||
xdr.onload = function () { reload(); };
|
// Make sure there isn't a reverse proxy in front that may just be returning 5xx codes
|
||||||
|
// Status code 4xx should still be allowed, since a page could potentially be removed, etc
|
||||||
|
xdr.onload = function () { if (xdr.status < 500) reload(); else setTimeout(serverPoll, 10000); };
|
||||||
xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
|
xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
|
||||||
xdr.send();
|
xdr.send();
|
||||||
}
|
}
|
||||||
|
@ -1849,7 +1849,9 @@
|
|||||||
if (!xdr) xdr = new XMLHttpRequest();
|
if (!xdr) xdr = new XMLHttpRequest();
|
||||||
xdr.open('HEAD', window.location.href);
|
xdr.open('HEAD', window.location.href);
|
||||||
xdr.timeout = 15000;
|
xdr.timeout = 15000;
|
||||||
xdr.onload = function () { reload(); };
|
// Make sure there isn't a reverse proxy in front that may just be returning 5xx codes
|
||||||
|
// Status code 4xx should still be allowed, since a page could potentially be removed, etc
|
||||||
|
xdr.onload = function () { if (xdr.status < 500) reload(); else setTimeout(serverPoll, 10000); };
|
||||||
xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
|
xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
|
||||||
xdr.send();
|
xdr.send();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user