Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: checks for nil Response or Response.Body in Client.send causing some internal Google tests to fail #38095
With https://golang.org/cl/221818, we do explicit checks to see if a
It’s documented that
Should we be enforcing a non-nil
Reading the package docs, perhaps we could relax this check.
https://golang.org/pkg/net/http/#Response says (emphasis mine):
// The http Client and Transport guarantee that Body is always // non-nil, even on responses without a body or responses with // a zero-length body. It is the caller's responsibility to // close Body. The default HTTP client's Transport may not // reuse HTTP/1.x "keep-alive" TCP connections if the Body is // not read to completion and closed.
which to me implies a non-nil