net/http: Document Content-Length behavior for servers #23450
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Go 1.9
Does this issue reproduce with the latest release?
Yes.
For a Go HTTP server, we noticed that sometimes it was setting the Content-Length header on responses, and sometimes it was not. The user code for the HTTP server didn't set Content-Length anywhere, so it must be the stdlib code. After some digging in the stdlib code, we found that Content-Length will be automatically set on small response bodies only. It would be good to document this in the
net/http
godocs.The text was updated successfully, but these errors were encountered: