content-length-range policy should be honored for the uploaded object sizes. (#3076)

This commit is contained in:
Krishna Srinivas
2016-10-25 12:17:03 +05:30
committed by Harshavardhana
parent 3977d6b7bd
commit 35e541e0b1
8 changed files with 79 additions and 34 deletions
+14
View File
@@ -81,6 +81,13 @@ func toObjectErr(err error, params ...string) error {
Object: params[1],
}
}
case errDataTooSmall:
if len(params) >= 2 {
err = ObjectTooSmall{
Bucket: params[0],
Object: params[1],
}
}
case errXLReadQuorum:
err = InsufficientReadQuorum{}
case errXLWriteQuorum:
@@ -266,6 +273,13 @@ func (e ObjectTooLarge) Error() string {
return "size of the object greater than what is allowed(5G)"
}
// ObjectTooSmall error returned when the size of the object < what is expected.
type ObjectTooSmall GenericError
func (e ObjectTooSmall) Error() string {
return "size of the object less than what is expected"
}
/// Multipart related errors.
// MalformedUploadID malformed upload id.