bucketPolicy: Trim incoming paths properly for policy verification.

master
Harshavardhana 8 years ago
parent 07aa02f196
commit 85e2d886bc
  1. 2
      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)

Loading…
Cancel
Save