diff --git a/api.go b/api.go index a21c40e80..8bcdc0d7c 100644 --- a/api.go +++ b/api.go @@ -588,7 +588,7 @@ func (c Client) newRequest(method string, metadata requestMetadata) (req *http.R } // Initialize a new HTTP request for the method. - req, err = http.NewRequest(method, targetURL.String(), nil) + req, err = http.NewRequest(method, targetURL.String(), metadata.contentBody) if err != nil { return nil, err } @@ -608,11 +608,6 @@ func (c Client) newRequest(method string, metadata requestMetadata) (req *http.R return req, nil } - // Set content body if available. - if metadata.contentBody != nil { - req.Body = ioutil.NopCloser(metadata.contentBody) - } - // FIXME: Enable this when Google Cloud Storage properly supports 100-continue. // Skip setting 'expect' header for Google Cloud Storage, there // are some known issues - https://github.com/restic/restic/issues/520