diff --git a/pkg/server/api.go b/pkg/server/api.go index 081c5962a5..16dc150dc6 100644 --- a/pkg/server/api.go +++ b/pkg/server/api.go @@ -134,7 +134,7 @@ type healthHandler struct{} func (h *healthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Length", "0") if r.Method == http.MethodGet || r.Method == http.MethodHead { - w.WriteHeader(http.StatusNoContent) + w.WriteHeader(http.StatusOK) return } diff --git a/pkg/server/api_test.go b/pkg/server/api_test.go index c4d179bdce..edb9a4be76 100644 --- a/pkg/server/api_test.go +++ b/pkg/server/api_test.go @@ -106,7 +106,7 @@ func TestHealthzHandler(t *testing.T) { return new(ignv2_2types.Config), nil }, checkResponse: func(t *testing.T, response *http.Response) { - checkStatus(t, response, http.StatusNoContent) + checkStatus(t, response, http.StatusOK) checkContentLength(t, response, 0) checkBodyLength(t, response, 0) }, @@ -118,7 +118,7 @@ func TestHealthzHandler(t *testing.T) { return new(ignv2_2types.Config), nil }, checkResponse: func(t *testing.T, response *http.Response) { - checkStatus(t, response, http.StatusNoContent) + checkStatus(t, response, http.StatusOK) checkContentLength(t, response, 0) checkBodyLength(t, response, 0) }, @@ -260,7 +260,7 @@ func TestAPIServer(t *testing.T) { return new(ignv2_2types.Config), nil }, checkResponse: func(t *testing.T, response *http.Response) { - checkStatus(t, response, http.StatusNoContent) + checkStatus(t, response, http.StatusOK) checkContentLength(t, response, 0) checkBodyLength(t, response, 0) }, @@ -272,7 +272,7 @@ func TestAPIServer(t *testing.T) { return new(ignv2_2types.Config), nil }, checkResponse: func(t *testing.T, response *http.Response) { - checkStatus(t, response, http.StatusNoContent) + checkStatus(t, response, http.StatusOK) checkContentLength(t, response, 0) checkBodyLength(t, response, 0) },