From 1c6da41bee44ce684a61e04598263d61ae373883 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 21 Jul 2020 17:43:45 +0300 Subject: [PATCH] NFSSVC-25 Isolate health-checkers - Add mime-type for health-check response - Remove legacy health-checkers --- cmd/gate/app-healthy.go | 7 +++++-- legacy/neofs-router.go | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/gate/app-healthy.go b/cmd/gate/app-healthy.go index d5f3b24..576fe4d 100644 --- a/cmd/gate/app-healthy.go +++ b/cmd/gate/app-healthy.go @@ -12,8 +12,9 @@ type Healthy interface { } const ( - healthyState = "NeoFS S3 Gateway is " - // defaultContentType = "text/plain; charset=utf-8" + healthyState = "NeoFS S3 Gateway is " + hdrContentType = "Content-Type" + defaultContentType = "text/plain; charset=utf-8" ) func attachHealthy(r *mux.Router, h Healthy) { @@ -22,6 +23,7 @@ func attachHealthy(r *mux.Router, h Healthy) { StrictSlash(true) healthy.HandleFunc("/ready", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set(hdrContentType, defaultContentType) w.WriteHeader(http.StatusOK) _, _ = fmt.Fprintln(w, healthyState+"ready") }) @@ -35,6 +37,7 @@ func attachHealthy(r *mux.Router, h Healthy) { code = http.StatusBadRequest } + w.Header().Set(hdrContentType, defaultContentType) w.WriteHeader(code) _, _ = fmt.Fprintln(w, healthyState+msg) }) diff --git a/legacy/neofs-router.go b/legacy/neofs-router.go index 44cf08b..7561ea0 100644 --- a/legacy/neofs-router.go +++ b/legacy/neofs-router.go @@ -41,9 +41,6 @@ func AttachS3API(r *mux.Router, obj ObjectLayer, l *zap.Logger) { globalServerConfigMu.Unlock() } - // Add healthcheck router - registerHealthCheckRouter(r) - // Add API router. registerAPIRouter(r, true, true)