From 4e933d21e0650b4106ffef2fcdfe8dfea15d24c7 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Thu, 30 Dec 2021 02:18:06 +0500 Subject: [PATCH] :recycle: Refactored health HTTP delivery --- internal/health/delivery/http/health_http.go | 3 +-- internal/health/delivery/http/health_http_test.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/health/delivery/http/health_http.go b/internal/health/delivery/http/health_http.go index 3844358..a55cf99 100644 --- a/internal/health/delivery/http/health_http.go +++ b/internal/health/delivery/http/health_http.go @@ -18,6 +18,5 @@ func (h *RequestHandler) Register(r *router.Router) { } func (h *RequestHandler) read(ctx *http.RequestCtx) { - ctx.SetContentType(common.MIMETextPlainCharsetUTF8) - ctx.SetStatusCode(http.StatusOK) + ctx.SuccessString(common.MIMEApplicationJSONCharsetUTF8, `{}`) } diff --git a/internal/health/delivery/http/health_http_test.go b/internal/health/delivery/http/health_http_test.go index 3201832..b579d25 100644 --- a/internal/health/delivery/http/health_http_test.go +++ b/internal/health/delivery/http/health_http_test.go @@ -29,4 +29,5 @@ func TestRequestHandler(t *testing.T) { require.NoError(t, client.Do(req, resp)) assert.Equal(t, http.StatusOK, resp.StatusCode()) + assert.Equal(t, `{}`, string(resp.Body())) }