Skip to content
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

net/http: Document Content-Length behavior for servers #23450

jsha opened this issue Jan 15, 2018 · 2 comments


None yet
4 participants
Copy link

commented Jan 15, 2018

What version of Go are you using (go version)?

Go 1.9

Does this issue reproduce with the latest release?


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.


This comment has been minimized.

Copy link

commented Jan 15, 2018

@titanous titanous added this to the Go1.11 milestone Jan 16, 2018

@titanous titanous added the NeedsFix label Jan 16, 2018


This comment has been minimized.

Copy link

commented May 29, 2018

Change mentions this issue: net/http: document Server's implicit Content-Length response header

@gopherbot gopherbot closed this in a4330ed May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.