mirror of
https://github.com/pgsty/minio.git
synced 2026-07-16 00:41:25 +03:00
multipart: reject part upload if size is less than 5MB. (#1518)
This commit is contained in:
committed by
Harshavardhana
parent
88e1c04259
commit
75320f70d0
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user