allow 401 and 403 errors to pass health check

way too many WP sites use some plugin to block health check routes.
maybe some day we will have dynamic health check route settable by user.
This commit is contained in:
Girish Ramakrishnan
2020-11-10 16:49:59 -08:00
parent 71666a028b
commit 86916a94de
+1 -1
View File
@@ -96,7 +96,7 @@ function checkAppHealth(app, callback) {
.end(function (error, res) {
if (error && !error.response) {
setHealth(app, apps.HEALTH_UNHEALTHY, callback);
} else if (res.statusCode >= 400) { // 2xx and 3xx are ok
} else if (res.statusCode >= 403) { // 2xx and 3xx are ok. even 401 and 403 are ok for now (for WP sites)
setHealth(app, apps.HEALTH_UNHEALTHY, callback);
} else {
setHealth(app, apps.HEALTH_HEALTHY, callback);