diff --git a/plugin/health/health.go b/plugin/health/health.go index 55ff68407..2ac75f08d 100644 --- a/plugin/health/health.go +++ b/plugin/health/health.go @@ -42,7 +42,7 @@ func (h *health) OnStartup() error { h.mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { // We're always healthy. w.WriteHeader(http.StatusOK) - io.WriteString(w, "OK") + io.WriteString(w, http.StatusText(http.StatusOK)) return }) diff --git a/plugin/health/health_test.go b/plugin/health/health_test.go index 7c7ad43a1..35ab285fe 100644 --- a/plugin/health/health_test.go +++ b/plugin/health/health_test.go @@ -31,7 +31,7 @@ func TestHealth(t *testing.T) { } response.Body.Close() - if string(content) != "OK" { + if string(content) != http.StatusText(http.StatusOK) { t.Errorf("Invalid response body: expecting 'OK', got '%s'", string(content)) } } diff --git a/plugin/ready/ready.go b/plugin/ready/ready.go index ff19b59f8..0b08c22f4 100644 --- a/plugin/ready/ready.go +++ b/plugin/ready/ready.go @@ -45,7 +45,7 @@ func (rd *ready) onStartup() error { ok, todo := plugins.Ready() if ok { w.WriteHeader(http.StatusOK) - io.WriteString(w, "OK") + io.WriteString(w, http.StatusText(http.StatusOK)) return } log.Infof("Still waiting on: %q", todo) diff --git a/test/reload_test.go b/test/reload_test.go index e026a97ce..f17a85b05 100644 --- a/test/reload_test.go +++ b/test/reload_test.go @@ -110,7 +110,7 @@ func TestReloadMetricsHealth(t *testing.T) { } ok, _ := ioutil.ReadAll(resp.Body) resp.Body.Close() - if string(ok) != "OK" { + if string(ok) != http.StatusText(http.StatusOK) { t.Errorf("Failed to receive OK, got %s", ok) }