[#531] Fix test_bucket_put_bad_canned_acl ceph test #597

Merged
alexvanin merged 1 commit from KurlesHS/frostfs-s3-gw:fix/malformed_acl_resp_code into master 2024-12-26 14:16:21 +00:00
2 changed files with 8 additions and 1 deletions

View file

@ -57,6 +57,7 @@ const (
ErrInvalidCopyDest ErrInvalidCopyDest
ErrInvalidPolicyDocument ErrInvalidPolicyDocument
ErrInvalidObjectState ErrInvalidObjectState
ErrMalformedACL
ErrMalformedXML ErrMalformedXML
ErrMissingContentLength ErrMissingContentLength
ErrMissingContentMD5 ErrMissingContentMD5
@ -456,6 +457,12 @@ var errorCodes = errorCodeMap{
Description: "The requested range is not satisfiable", Description: "The requested range is not satisfiable",
HTTPStatusCode: http.StatusRequestedRangeNotSatisfiable, HTTPStatusCode: http.StatusRequestedRangeNotSatisfiable,
}, },
ErrMalformedACL: {
ErrCode: ErrMalformedACL,
Code: "MalformedACLError",
Description: "The ACL that you provided was not well formed or did not validate against our published schema.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrMalformedXML: { ErrMalformedXML: {
ErrCode: ErrMalformedXML, ErrCode: ErrMalformedXML,
Code: "MalformedXML", Code: "MalformedXML",

View file

@ -744,7 +744,7 @@ func parseCannedACL(header http.Header) (string, error) {
return acl, nil return acl, nil
} }
return "", fmt.Errorf("unknown acl: %s", acl) return "", apierr.GetAPIErrorWithError(apierr.ErrMalformedACL, fmt.Errorf("unknown acl: %s", acl))
} }
func (h *handler) CreateBucketHandler(w http.ResponseWriter, r *http.Request) { func (h *handler) CreateBucketHandler(w http.ResponseWriter, r *http.Request) {