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_test.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_test.go')
-rw-r--r-- | vendor/github.com/minio/minio-go/api-put-bucket_test.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/vendor/github.com/minio/minio-go/api-put-bucket_test.go b/vendor/github.com/minio/minio-go/api-put-bucket_test.go index a1899fbe2..ec33c8492 100644 --- a/vendor/github.com/minio/minio-go/api-put-bucket_test.go +++ b/vendor/github.com/minio/minio-go/api-put-bucket_test.go @@ -24,8 +24,10 @@ import ( "io" "io/ioutil" "net/http" - "net/url" + "path" "testing" + + "github.com/minio/minio-go/pkg/s3signer" ) // Tests validate http request formulated for creation of bucket. @@ -33,14 +35,11 @@ func TestMakeBucketRequest(t *testing.T) { // Generates expected http request for bucket creation. // Used for asserting with the actual request generated. createExpectedRequest := func(c *Client, bucketName string, location string, req *http.Request) (*http.Request, error) { - - 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. + var err error req, err = http.NewRequest("PUT", targetURL.String(), nil) if err != nil { return nil, err @@ -78,9 +77,9 @@ func TestMakeBucketRequest(t *testing.T) { 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. |