net/http: Response.Write includes Content-Length header on 204s #16942
Comments
https://tools.ietf.org/html/rfc7230#section-3.3.2
|
Oh, we're fine actually. This is a bug in Response.Write. It's correct on the network: |
Athough this appears to be specifically about 204, an existing test expects Content-Length with a status code of 1xx. |
@0xmohit, that test can be changed. |
CL https://golang.org/cl/28351 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Apparently we send a Content-Length header on a 204 response:
https://play.golang.org/p/bxy_rEBy-s
A 204 can't have a body anyway, so the Content-Length is useless and misleading. (It might be a protocol violation? Haven't checked.)
The text was updated successfully, but these errors were encountered: