Return error for empty parts in multipartupload complete (#1758)

This commit is contained in:
Krishnan Parthasarathi 2016-05-26 00:41:26 +05:30 committed by Harshavardhana
parent a4771265cf
commit 3550660163

View File

@ -941,6 +941,10 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
writeErrorResponse(w, r, ErrMalformedXML, r.URL.Path)
return
}
if len(complMultipartUpload.Parts) == 0 {
writeErrorResponse(w, r, ErrMalformedXML, r.URL.Path)
return
}
if !sort.IsSorted(completedParts(complMultipartUpload.Parts)) {
writeErrorResponse(w, r, ErrInvalidPartOrder, r.URL.Path)
return