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

Closed
jsha opened this issue Jan 15, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@jsha
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?

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.

@mvdan

This comment has been minimized.

Copy link
Member

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

@gopherbot

This comment has been minimized.

Copy link

commented May 29, 2018

Change https://golang.org/cl/115040 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.