ivandika3 commented on code in PR #9294:
URL: https://github.com/apache/ozone/pull/9294#discussion_r2616673681
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -337,12 +349,26 @@ public Response put(
long metadataLatencyNs =
getMetrics().updatePutKeyMetadataStats(startNanos);
perf.appendMetaLatencyNanos(metadataLatencyNs);
- putLength = IOUtils.copyLarge(digestInputStream, output, 0, length,
+ putLength = IOUtils.copyLarge(multiDigestInputStream, output, 0,
length,
new byte[getIOBufferSize(length)]);
eTag = DatatypeConverter.printHexBinary(
- digestInputStream.getMessageDigest().digest())
+
multiDigestInputStream.getMessageDigest(OzoneConsts.MD5_HASH).digest())
.toLowerCase();
output.getMetadata().put(ETAG, eTag);
+
+ final String amzContentSha256Header =
+ validateSignatureHeader(headers, keyPath,
signatureInfo.isSignPayload());
Review Comment:
Let's push `validateSignatureHeader` before any metadata or data ops (i.e.
`createKey` and `IOUtils#copyLarge`) to prevent unnecessary (meta)data
transfer. Should be applied to other places.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]