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
Closed

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

jsha opened this issue Jan 15, 2018 · 2 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jsha
Copy link

jsha 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
Copy link
Member

mvdan commented Jan 15, 2018

/cc @bradfitz @tombergan

@titanous titanous added this to the Go1.11 milestone Jan 16, 2018
@titanous titanous added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 16, 2018
@gopherbot
Copy link

Change https://golang.org/cl/115040 mentions this issue: net/http: document Server's implicit Content-Length response header

@golang golang locked and limited conversation to collaborators May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants