diff --git a/server.ts b/server.ts index b8ec65ef049..568e41b3a71 100644 --- a/server.ts +++ b/server.ts @@ -678,10 +678,12 @@ function healthCheck(req, res) { const baseUrl = `${REST_BASE_URL}${environment.actuators.endpointPath}`; fetch(baseUrl) .then((response) => { - res.status(response.status).send(response); + return response.json().then((data) => { + res.status(response.status).send(data); + }); }) .catch((error) => { - res.status(error.response.status).send({ + res.status(error?.response?.status || 503).send({ error: error.message, }); });