diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-02-02 09:32:00 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-02-02 09:32:00 -0500 |
commit | 701d1ab638b23c24877fc41824add66232446676 (patch) | |
tree | ec120c88d38ac9d38d9eabdd3270b52bb6ac9d96 /vendor/github.com/minio/minio-go/api-put-bucket.go | |
parent | ca3211bc04f6dea34e8168217182637d1419f998 (diff) | |
download | chat-701d1ab638b23c24877fc41824add66232446676.tar.gz chat-701d1ab638b23c24877fc41824add66232446676.tar.bz2 chat-701d1ab638b23c24877fc41824add66232446676.zip |
Updating server dependancies (#5249)
Diffstat (limited to 'vendor/github.com/minio/minio-go/api-put-bucket.go')
-rw-r--r-- | vendor/github.com/minio/minio-go/api-put-bucket.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/github.com/minio/minio-go/api-put-bucket.go b/vendor/github.com/minio/minio-go/api-put-bucket.go index 3c9f438ef..7c7e03f49 100644 --- a/vendor/github.com/minio/minio-go/api-put-bucket.go +++ b/vendor/github.com/minio/minio-go/api-put-bucket.go @@ -26,8 +26,10 @@ import ( "io/ioutil" "net/http" "net/url" + "path" "github.com/minio/minio-go/pkg/policy" + "github.com/minio/minio-go/pkg/s3signer" ) /// Bucket operations @@ -89,11 +91,8 @@ func (c Client) makeBucketRequest(bucketName string, location string) (*http.Req // is the preferred method here. The final location of the // 'bucket' is provided through XML LocationConstraint data with // the request. - targetURL, err := url.Parse(c.endpointURL) - if err != nil { - return nil, err - } - targetURL.Path = "/" + bucketName + "/" + targetURL := c.endpointURL + targetURL.Path = path.Join(bucketName, "") + "/" // get a new HTTP request for the method. req, err := http.NewRequest("PUT", targetURL.String(), nil) @@ -133,9 +132,9 @@ func (c Client) makeBucketRequest(bucketName string, location string) (*http.Req if c.signature.isV4() { // Signature calculated for MakeBucket request should be for 'us-east-1', // regardless of the bucket's location constraint. - req = signV4(*req, c.accessKeyID, c.secretAccessKey, "us-east-1") + req = s3signer.SignV4(*req, c.accessKeyID, c.secretAccessKey, "us-east-1") } else if c.signature.isV2() { - req = signV2(*req, c.accessKeyID, c.secretAccessKey) + req = s3signer.SignV2(*req, c.accessKeyID, c.secretAccessKey) } // Return signed request. |