When logging requests and the request is a websocket and the websocket is not properly closed (e.g. the client reloads the page, disconnecting the socket), then hlog tries to write http.StatusOK via WriteHeader() to the hijacked connection which fails as described here
This PR addresses this problem by passing a flag into the WrapWriter() func to indicate whether the request is a Websocket. In this case, the WriteHeader() is suppressed.
When logging requests and the request is a websocket and the websocket is not properly closed (e.g. the client reloads the page, disconnecting the socket), then hlog tries to write
http.StatusOK
viaWriteHeader()
to the hijacked connection which fails as described herehttps://stackoverflow.com/questions/32657603/why-do-i-get-the-error-message-http-response-write-on-hijacked-connection
This PR addresses this problem by passing a flag into the
WrapWriter()
func to indicate whether the request is a Websocket. In this case, theWriteHeader()
is suppressed.