Closed
Description
The net/http.Request docs say:
// The protocol version for incoming server requests.
//
// For client requests these fields are ignored. The HTTP
// client code always uses either HTTP/1.1 or HTTP/2.
// See the docs on Transport for details.
Proto string // "HTTP/1.0"
ProtoMajor int // 1
ProtoMinor int // 0
But that turns out not to be true. transfer.go's func newTransferWriter
checks for instance:
case *Request:
...
atLeastHTTP11 = rr.ProtoAtLeast(1, 1)
...
if t.ContentLength < 0 && len(t.TransferEncoding) == 0 && atLeastHTTP11 {
t.TransferEncoding = []string{"chunked"}
}
This bug is to audit investigate either fixing the implementation (if possible), or fixing the docs, and auditing any other locations. Hopefully it's fixable and doesn't require documentation.