Skip to content

Commit

Permalink
Merge pull request #7 from jojohappy/make_reader_closer_as_a_nop
Browse files Browse the repository at this point in the history
To wrap the closer as a nop for request body
  • Loading branch information
mozillazg committed Nov 1, 2018
2 parents 7c1d230 + 884aacb commit 2039138
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cos.go
Expand Up @@ -177,6 +177,7 @@ func (c *Client) newRequest(ctx context.Context, opt *sendOptions) (req *http.Re
}
if v := req.Header.Get("Content-Length"); req.ContentLength == 0 && v != "" && v != "0" {
req.ContentLength, _ = strconv.ParseInt(v, 10, 64)
req.Body = ioutil.NopCloser(reader)
}

if contentMD5 != "" {
Expand Down

0 comments on commit 2039138

Please sign in to comment.