Presigend Post: Error out when File is not found (#3723)

Follow S3 behavior when no File is sent in the presigned
post request form.
This commit is contained in:
Anis Elleuch
2017-02-09 21:37:32 +01:00
committed by Harshavardhana
parent 6800902b43
commit c9b1468c3b
3 changed files with 19 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ const (
ErrInvalidPartOrder
ErrAuthorizationHeaderMalformed
ErrMalformedPOSTRequest
ErrPOSTFileRequired
ErrSignatureVersionNotSupported
ErrBucketNotEmpty
ErrAllAccessDisabled
@@ -333,6 +334,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description: "The body of your POST request is not well-formed multipart/form-data.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrPOSTFileRequired: {
Code: "InvalidArgument",
Description: "POST requires exactly one file upload per request.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrSignatureVersionNotSupported: {
Code: "InvalidRequest",
Description: "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.",