Emit InvalidPart when missing an MPU part

pull/59/head
Andrew Gaul 2015-05-02 11:05:31 -07:00
rodzic 709d2b5f58
commit ceb805ef0a
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -49,6 +49,10 @@ enum S3ErrorCode {
"The specified location constraint is not valid. For" +
" more information about Regions, see How to Select" +
" a Region for Your Buckets."),
INVALID_PART(HttpServletResponse.SC_BAD_REQUEST,
"One or more of the specified parts could not be found." +
" The part may not have been uploaded, or the specified entity" +
" tag may not match the part's entity tag."),
INVALID_REQUEST(HttpServletResponse.SC_BAD_REQUEST, "Bad Request"),
MALFORMED_X_M_L(HttpServletResponse.SC_BAD_REQUEST,
"The XML you provided was not well-formed or did not validate" +

Wyświetl plik

@ -1239,7 +1239,11 @@ final class S3ProxyHandler extends AbstractHandler {
parseCompleteMultipartUpload(is).entrySet().iterator();
it.hasNext();) {
Map.Entry<Integer, String> entry = it.next();
long partSize = partsByListing.get(entry.getKey()).partSize();
MultipartPart part = partsByListing.get(entry.getKey());
if (part == null) {
throw new S3Exception(S3ErrorCode.INVALID_PART);
}
long partSize = part.partSize();
if (partSize < blobStore.getMinimumMultipartPartSize() &&
partSize != -1 && it.hasNext()) {
throw new S3Exception(S3ErrorCode.ENTITY_TOO_SMALL);