From 0dd29f48980e5b533f8c494a32766d24f6d22213 Mon Sep 17 00:00:00 2001 From: Michal Turcan Date: Mon, 10 Oct 2022 19:55:31 +0200 Subject: [PATCH] changing ok response to json to match error --- client/rpc/status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/rpc/status.go b/client/rpc/status.go index 39a8dce5b9d8..7d784c68d0e8 100644 --- a/client/rpc/status.go +++ b/client/rpc/status.go @@ -131,6 +131,10 @@ func NodeSyncingRequestHandlerFn(clientCtx client.Context) http.HandlerFunc { } } +type HealthcheckResponse struct { + Health string `json:"health"` +} + // REST handler for node health check - aws recognizes only http status codes func NodeHealthRequestHandlerFn(clientCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { @@ -141,7 +145,7 @@ func NodeHealthRequestHandlerFn(clientCtx client.Context) http.HandlerFunc { if status.SyncInfo.CatchingUp { rest.WriteErrorResponse(w, http.StatusServiceUnavailable, "NOK") } else { - rest.PostProcessResponseBare(w, clientCtx, []byte("OK")) + rest.PostProcessResponseBare(w, clientCtx, HealthcheckResponse{Health: "OK"}) } } }