When object whose size is greater than 5G is uploaded using presigned POST we should return error. (#3033)

fixes #2961
This commit is contained in:
Krishna Srinivas
2016-10-22 21:35:01 +05:30
committed by Harshavardhana
parent e51be73ac7
commit 5999a23d3e
6 changed files with 65 additions and 1 deletions
+14
View File
@@ -74,6 +74,13 @@ func toObjectErr(err error, params ...string) error {
Object: params[1],
}
}
case errDataTooLarge:
if len(params) >= 2 {
err = ObjectTooLarge{
Bucket: params[0],
Object: params[1],
}
}
case errXLReadQuorum:
err = InsufficientReadQuorum{}
case errXLWriteQuorum:
@@ -252,6 +259,13 @@ func (e InvalidRange) Error() string {
return fmt.Sprintf("The requested range \"bytes %d-%d/%d\" is not satisfiable.", e.offsetBegin, e.offsetEnd, e.resourceSize)
}
// ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.
type ObjectTooLarge GenericError
func (e ObjectTooLarge) Error() string {
return "size of the object greater than what is allowed(5G)"
}
/// Multipart related errors.
// MalformedUploadID malformed upload id.