8000 Add property to disable Put MD5 validation · senthgit/aws-sdk-java@df98496 · GitHub
[go: up one dir, main page]

Skip to content

Commit df98496

Browse files
committed
Add property to disable Put MD5 validation
Some object stores like S3Proxy with the Azure backend do not return the MD5 sum for ETag. Fixes gaul/s3proxy#96.
1 parent 83b94cf commit df98496

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/ServiceUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,13 @@ public static boolean skipMd5CheckPerResponse(ObjectMetadata metadata) {
432432
/**
433433
* Based on the given request object, returns whether the specified request
434434
* should skip MD5 check on the requested object content. Specifically, MD5
435-
* check should be skipped if one of the following condition is true:
435+
* check should be skipped if one of the following conditions are true:
436436
* <ol>
437437
* <li>The system property
438438
*
439439
* <pre>
440440
* -Dcom.amazonaws.services.s3.disableGetObjectMD5Validation
441+
* -Dcom.amazonaws.services.s3.disablePutObjectMD5Validation
441442
* </pre>
442443
*
443444
* is specified;</li>
@@ -460,10 +461,14 @@ public static boolean skipMd5CheckPerRequest(AmazonWebServiceRequest request) {
460461
if (getObjectRequest.getSSECustomerKey() != null)
461462
return true;
462463
} else if (request instanceof PutObjectRequest) {
464+
if (System.getProperty("com.amazonaws.services.s3.disablePutObjectMD5Validation") != null)
465+
return true;
463466
PutObjectRequest putObjectRequest = (PutObjectRequest)request;
464467
return putObjectRequest.getSSECustomerKey() != null
465468
|| putObjectRequest.getSSEAwsKeyManagementParams() != null;
466469
} else if (request instanceof UploadPartRequest) {
470+
if (System.getProperty("com.amazonaws.services.s3.disablePutObjectMD5Validation") != null)
471+
return true;
467472
UploadPartRequest uploadPartRequest = (UploadPartRequest)request;
468473
return uploadPartRequest.getSSECustomerKey() != null;
469474
}

0 commit comments

Comments
 (0)
0