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
+6
View File
@@ -428,6 +428,12 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h
return
}
// Check if file is provided, error out otherwise.
if fileBody == nil {
writeErrorResponse(w, ErrPOSTFileRequired, r.URL)
return
}
// Close multipart file
defer fileBody.Close()