Skip to content

Commit

Permalink
Merge pull request #392 from wangmingshuai/master
Browse files Browse the repository at this point in the history
S3 Compatible:support RadosGW when using goamz in docker registry
  • Loading branch information
alimoeeny committed Sep 1, 2015
2 parents 509360a + e5e3387 commit 01b9e62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions s3/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/xml"
"errors"
"io"
"net/http"
"net/url"
"sort"
"strconv"
Expand Down Expand Up @@ -428,6 +429,11 @@ func (m *Multi) Complete(parts []Part) error {
payload: bytes.NewReader(data),
}
var resp completeUploadResp
if m.Bucket.Region.Name == "generic" {
headers := make(http.Header)
headers.Add("Content-Length", strconv.FormatInt(int64(len(data)), 10))
req.headers = headers
}
err := m.Bucket.S3.query(req, &resp)
if shouldRetry(err) && attempt.HasNext() {
continue
Expand Down
4 changes: 3 additions & 1 deletion s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,9 @@ func (s3 *S3) setupHttpRequest(req *request) (*http.Request, error) {
if err != nil {
return nil, err
}
u.Opaque = fmt.Sprintf("//%s%s", u.Host, partiallyEscapedPath(u.Path))
if s3.Region.Name != "generic" {
u.Opaque = fmt.Sprintf("//%s%s", u.Host, partiallyEscapedPath(u.Path))
}

hreq := http.Request{
URL: u,
Expand Down

0 comments on commit 01b9e62

Please sign in to comment.