api: BucketNotification should disallow duplicate notification. (#2539)

Added checks to look for duplicated notification configs.

Fixes #2472
This commit is contained in:
Harshavardhana
2016-08-23 18:42:30 -07:00
committed by GitHub
parent c39d3db7a0
commit ec4260d260
6 changed files with 113 additions and 43 deletions

View File

@@ -119,6 +119,7 @@ const (
ErrFilterNamePrefix
ErrFilterNameSuffix
ErrFilterValueInvalid
ErrOverlappingConfigs
// S3 extended errors.
ErrContentSHA256Mismatch
@@ -505,6 +506,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description: "Size of filter rule value cannot exceed 1024 bytes in UTF-8 representation",
HTTPStatusCode: http.StatusBadRequest,
},
ErrOverlappingConfigs: {
Code: "InvalidArgument",
Description: "Configurations overlap. Configurations on the same bucket cannot share a common event type.",
HTTPStatusCode: http.StatusBadRequest,
},
/// S3 extensions.
ErrContentSHA256Mismatch: {