update doucmentaiton comment
This commit is contained in:
parent
341db84788
commit
c42caf78a2
@ -14,6 +14,11 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R
|
|||||||
var retryBuf io.Reader
|
var retryBuf io.Reader
|
||||||
|
|
||||||
if body != nil {
|
if body != nil {
|
||||||
|
// Because Request#Do closes closable streams, Seeker#Seek
|
||||||
|
// will fail on retry because stream is already closed.
|
||||||
|
// This inhibits the closing of the passed stream on passing
|
||||||
|
// it to the RoundTripper and closes the stream after we
|
||||||
|
// are done with the body content.
|
||||||
if cl, ok := body.(io.Closer); ok {
|
if cl, ok := body.(io.Closer); ok {
|
||||||
body = closeInhibitor{body}
|
body = closeInhibitor{body}
|
||||||
defer cl.Close()
|
defer cl.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user