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)