multipart: reject part upload if size is less than 5MB. (#1518)

This commit is contained in:
Krishna Srinivas
2016-05-09 00:36:05 +05:30
committed by Harshavardhana
parent 88e1c04259
commit 75320f70d0
6 changed files with 39 additions and 7 deletions
+7
View File
@@ -38,6 +38,8 @@ func checkValidMD5(md5 string) ([]byte, error) {
const (
// maximum object size per PUT request is 5GiB
maxObjectSize = 1024 * 1024 * 1024 * 5
// minimum Part size for multipart upload is 5MB
minPartSize = 1024 * 1024 * 5
)
// isMaxObjectSize - verify if max object size
@@ -45,6 +47,11 @@ func isMaxObjectSize(size int64) bool {
return size > maxObjectSize
}
// Check if part size is more than or equal to minimum allowed size.
func isMinAllowedPartSize(size int64) bool {
return size >= minPartSize
}
func contains(stringList []string, element string) bool {
for _, e := range stringList {
if e == element {