Reply back CompleteMultipartUploadResult properly with final ETag computed

- Now s3 libraries and also objectstorage-go work properly
This commit is contained in:
Harshavardhana
2015-05-07 22:43:19 -07:00
parent 5a372f4dd7
commit 82c3656f79
9 changed files with 104 additions and 36 deletions
+14 -2
View File
@@ -35,11 +35,11 @@ func isValidMD5(md5 string) bool {
}
/// http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html
// these should be configurable?
const (
// maximum object size per PUT request is 5GB
maxObjectSize = 1024 * 1024 * 1024 * 5
// mimimum object size per Multipart PUT request is 5MB
minMultiPartObjectSize = 1024 * 1024 * 5
// minimum object size per PUT request is 1B
minObjectSize = 1
)
@@ -67,3 +67,15 @@ func isMinObjectSize(size string) bool {
}
return false
}
// isMinMultipartObjectSize - verify if the uploaded multipart is of minimum size
func isMinMultipartObjectSize(size string) bool {
i, err := strconv.ParseInt(size, 10, 64)
if err != nil {
return true
}
if i < minMultiPartObjectSize {
return true
}
return false
}