From d7a9407a875dd961504d5c36f8a9fcb17dce6506 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 4 Mar 2015 01:20:28 -0800 Subject: [PATCH] Previous fix was incomplete move the '/' around to signature consistency --- pkg/s3/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/s3/client.go b/pkg/s3/client.go index edef1630..7bc7e1be 100644 --- a/pkg/s3/client.go +++ b/pkg/s3/client.go @@ -90,9 +90,9 @@ func (c *Client) bucketURL(bucket string) string { if strings.Contains(c.endpoint(), "localhost") || strings.Contains(bucket, "127.0.0.1") { url_ = fmt.Sprintf("%s/%s", c.endpoint(), bucket) } else if strings.Contains(c.endpoint(), "amazonaws.com") { - url_ = fmt.Sprintf("https://%s.%s", bucket, strings.TrimPrefix(c.endpoint(), "https://")) + url_ = fmt.Sprintf("https://%s.%s/", bucket, strings.TrimPrefix(c.endpoint(), "https://")) } else { - url_ = fmt.Sprintf("http://%s.%s", bucket, strings.TrimPrefix(c.endpoint(), "http://")) + url_ = fmt.Sprintf("http://%s.%s/", bucket, strings.TrimPrefix(c.endpoint(), "http://")) } return url_ } @@ -101,7 +101,7 @@ func (c *Client) bucketURL(bucket string) string { } func (c *Client) keyURL(bucket, key string) string { - return c.bucketURL(bucket) + "/" + key + return c.bucketURL(bucket) + key } func newReq(url_ string) *http.Request {