From 0298c3ddf6503b769b74a8728bee603c10c0bc93 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 6 Feb 2015 20:39:58 -0800 Subject: [PATCH] Never send request with trailing '/' for buckets --- pkg/s3/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/s3/client.go b/pkg/s3/client.go index a62937cd..ee668b52 100644 --- a/pkg/s3/client.go +++ b/pkg/s3/client.go @@ -65,12 +65,12 @@ func (c *Client) bucketURL(bucket string) string { return fmt.Sprintf("https://%s.%s/", bucket, strings.TrimPrefix(c.hostname(), "https://")) } } - return fmt.Sprintf("%s/%s/", c.hostname(), bucket) + return fmt.Sprintf("%s/%s", c.hostname(), bucket) } func (c *Client) keyURL(bucket, key string) string { - return c.bucketURL(bucket) + key + return c.bucketURL(bucket) + "/" + key } func newReq(url_ string) *http.Request {