forked from TrueCloudLab/frostfs-s3-gw
[#531] Fix the error codes when checking the ACL format
Signed-off-by: Aleksey Kravchenko <al.kravchenko@yadro.com>
This commit is contained in:
parent
a725c68d06
commit
e060308318
2 changed files with 8 additions and 1 deletions
|
@ -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",
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue