Skip to content

Commit

Permalink
Revert passing content body to http request (minio#619)
Browse files Browse the repository at this point in the history
This change was intended for go 1.8 but it is too
early to switch to the new version of go.
  • Loading branch information
vadmeste authored and harshavardhana committed Mar 9, 2017
1 parent 7a3619e commit f804d79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 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(), metadata.contentBody)
req, err = http.NewRequest(method, targetURL.String(), nil)
if err != nil {
return nil, err
}
Expand All @@ -608,6 +608,11 @@ 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 f804d79

Please sign in to comment.