-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid HTTP status code 0 #897
Comments
Can you provide a minimal repro? I've tried to reproduce with the I think that the helper in |
https://gist.github.com/vmihailenco/1028b37642cd04ed0222cfe8a3125dbf prints
It just records the status code. I don't see how it does anything beyond that. |
The Is there a valid use for an |
No calls to WriteHeader means |
I don't think it does. No calls to I can't think of a valid reason for an HTTP handler to provide zero response to a request, but it was easy to make a change in #908 that may avoid unexpected behavior. |
In my universe it always sends 200 OK. |
http.Handler that does not explicitly sets HTTP status code gets following attributes:
At least the status message looks wrong because Go uses
200 OK
status code when status code is not explicitly set. So the status code is known and is valid.The text was updated successfully, but these errors were encountered: