Delete ip property from check

This commit is contained in:
PJ 2022-01-17 13:40:39 +01:00
parent 45e0398afe
commit 4096a7ebf2
No known key found for this signature in database
GPG Key ID: F345964979FA8971
1 changed files with 5 additions and 2 deletions

View File

@ -180,14 +180,17 @@ async function blockerHealthCheck(done) {
data.statusCode = response.statusCode; data.statusCode = response.statusCode;
data.response = response.body; data.response = response.body;
data.up = response.body.dbAlive === true; data.up = response.body.dbAlive === true;
data.ip = response.ip;
} catch (error) { } catch (error) {
data.statusCode = error?.response?.statusCode || error.statusCode || error.status; data.statusCode = error?.response?.statusCode || error.statusCode || error.status;
data.errorMessage = error.message; data.errorMessage = error.message;
data.errorResponseContent = getResponseContent(error.response); data.errorResponseContent = getResponseContent(error.response);
data.ip = error?.response?.ip ?? null;
} }
// this is a no-op but it's added to explicitly document the ip property
// should not be set on the data object to prevent the IP from being compared
// to the server's IP - this is not required for this check and will fail
delete data.ip
done({ name: "blocker", time: calculateElapsedTime(time), ...data }); done({ name: "blocker", time: calculateElapsedTime(time), ...data });
} }