From 85e2d886bcb005d49f3876d6849a2b5a55e03cd3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 11 Sep 2016 10:33:49 -0700 Subject: [PATCH] bucketPolicy: Trim incoming paths properly for policy verification. --- cmd/bucket-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bucket-handlers.go b/cmd/bucket-handlers.go index e39984242..83a21cfcb 100644 --- a/cmd/bucket-handlers.go +++ b/cmd/bucket-handlers.go @@ -42,7 +42,7 @@ func enforceBucketPolicy(bucket string, action string, reqURL *url.URL) (s3Error } // Construct resource in 'arn:aws:s3:::examplebucket/object' format. - resource := AWSResourcePrefix + strings.TrimPrefix(reqURL.Path, "/") + resource := AWSResourcePrefix + strings.TrimSuffix(strings.TrimPrefix(reqURL.Path, "/"), "/") // Get conditions for policy verification. conditionKeyMap := make(map[string]set.StringSet)