fix: Sets limit to tag set count to 10 for PutObjectTagging and 50 for PutBucketTagging

Fixes #1204
Fixes #1205

Tag count in `PutBucketTagging` and `PutObjectTagging` is limited.
`PutBucketTagging`: 50
`PutObjectTagging`: 10

Adds the changes to return errors respectively
This commit is contained in:
niksis02
2025-04-11 21:07:08 +04:00
parent b5c98b0106
commit 66b979ee86
4 changed files with 99 additions and 0 deletions

View File

@@ -85,6 +85,8 @@ const (
ErrInvalidCopySource
ErrInvalidCopySourceRange
ErrInvalidTag
ErrBucketTaggingLimited
ErrObjectTaggingLimited
ErrAuthHeaderEmpty
ErrSignatureVersionNotSupported
ErrMalformedPOSTRequest
@@ -311,6 +313,16 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "The Tag value you have provided is invalid",
HTTPStatusCode: http.StatusBadRequest,
},
ErrBucketTaggingLimited: {
Code: "BadRequest",
Description: "Bucket tag count cannot be greater than 50",
HTTPStatusCode: http.StatusBadRequest,
},
ErrObjectTaggingLimited: {
Code: "BadRequest",
Description: "Object tags cannot be greater than 10",
HTTPStatusCode: http.StatusBadRequest,
},
ErrMalformedXML: {
Code: "MalformedXML",
Description: "The XML you provided was not well-formed or did not validate against our published schema.",