diff --git a/requests.go b/requests.go index 1fc00ac..0e68867 100644 --- a/requests.go +++ b/requests.go @@ -14,6 +14,11 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R var retryBuf io.Reader 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 { body = closeInhibitor{body} defer cl.Close()