Handle zero-length multi-part upload

pull/29/merge
Andrew Gaul 2015-03-02 15:24:08 -08:00
rodzic 6d5f380590
commit 0337a4e4bc
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -50,6 +50,9 @@ enum S3ErrorCode {
" more information about Regions, see How to Select" +
" a Region for Your Buckets."),
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" +
" against our published schema."),
METHOD_NOT_ALLOWED(HttpServletResponse.SC_METHOD_NOT_ALLOWED,
"Method Not Allowed"),
MISSING_CONTENT_LENGTH(HttpServletResponse.SC_LENGTH_REQUIRED,

Wyświetl plik

@ -1363,6 +1363,13 @@ final class S3ProxyHandler extends AbstractHandler {
totalContentLength += contentLength;
}
if (partNames.isEmpty()) {
// Amazon requires at least one part
sendSimpleErrorResponse(response,
S3ErrorCode.MALFORMED_X_M_L);
return;
}
BlobMetadata blobMetadata = blobStore.blobMetadata(
containerName, uploadId);
ContentMetadata contentMetadata =