Skip to content

Fix logged status code for empty HTTP response

Jacob Vosmaer requested to merge jv-fix-empty-response-status-code into master

Part of gitlab-com/gl-infra/scalability#332 (closed)

If you define an empty HTTP handler in Go, the net/http server will respond to the client with an empty response and status 200. This edge case is not handled correctly by the labkit access log: labkit will log status 0.

This MR addresses this problem. In the special case that the upstream never wrote anything back to the client, we now log status 200.

Edited by Jacob Vosmaer

Merge request reports