You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected the Response.ContentLength to be set. Since a bytes.Buffer is used for recording the response body, the content length can be set using Buffer.Len.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.7
What operating system and processor architecture are you using (
go env
)?n/a.
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
See https://play.golang.org/p/pWT6IMacni.
What did you expect to see?
Expected the
Response.ContentLength
to be set. Since a bytes.Buffer is used for recording the response body, the content length can be set using Buffer.Len.What did you see instead?
As seen in https://github.com/golang/go/blob/master/src/net/http/httptest/recorder.go#L143-L188, the
Response.ContentLength
is never set.I could write a patch if it would be accepted.
The text was updated successfully, but these errors were encountered: