From 884aacb60e5bf6619dda2a16d31c25353cbf338b Mon Sep 17 00:00:00 2001 From: jojohappy Date: Tue, 30 Oct 2018 16:43:15 +0800 Subject: [PATCH] To wrap the closer as a nop for request body Signed-off-by: jojohappy --- cos.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cos.go b/cos.go index 3658656..b90bf95 100644 --- a/cos.go +++ b/cos.go @@ -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 != "" {