Skip to content

Commit

Permalink
Revert "Revert passing content body to http request (#619)" (#621)
Browse files Browse the repository at this point in the history
This reverts commit f804d79. One bug
was wrongly understood and led to a wrong revert.
  • Loading branch information
vadmeste authored and harshavardhana committed Mar 10, 2017
1 parent 23b2696 commit 1ab82c5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 1ab82c5

Please sign in to comment.