Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert passing content body to http request #619

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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