You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some endpoints that do not correctly log success status 200, instead they log 0.
Only affects logging.
Cause: This happends if the endpoint implementation neither calls WriteHeader nor writes a response body. http.Server still sends a default status 200, but the request wrapper used to record the status for logging doesn't know this, and logs 0.
Solution: explicitly call w.WriteHeader(http.StatusOK) at the end of the endpoint handler. It's clearer anyway.
The text was updated successfully, but these errors were encountered:
We have some endpoints that do not correctly log success status 200, instead they log 0.
Only affects logging.
Cause: This happends if the endpoint implementation neither calls WriteHeader nor writes a response body. http.Server still sends a default status 200, but the request wrapper used to record the status for logging doesn't know this, and logs 0.
Solution: explicitly call
w.WriteHeader(http.StatusOK)
at the end of the endpoint handler. It's clearer anyway.The text was updated successfully, but these errors were encountered: