Skip to content

Commit

Permalink
fix: return 204 No Content from /metrics endpoint
Browse files Browse the repository at this point in the history
* Change status code to NO_CONTENT

* Adjust integration tests
  • Loading branch information
wtrocki authored and Dara Hayes committed Mar 8, 2018
1 parent 5d42dc4 commit 829427d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/web/metricsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ func (mh *metricsHandler) CreateMetric(w http.ResponseWriter, r *http.Request) {
return
}

w.WriteHeader(200)
w.WriteHeader(204)
}
2 changes: 1 addition & 1 deletion pkg/web/metricsHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestMetricsEndpointShouldPassReceivedDataToMetricsService(t *testing.T) {
defer res.Body.Close()
_, err = ioutil.ReadAll(res.Body)

assert.Equal(t, 200, res.StatusCode)
assert.Equal(t, 204, res.StatusCode)

mockMetricsService.AssertExpectations(t)
}
Expand Down

0 comments on commit 829427d

Please sign in to comment.