Tejaskriya commented on code in PR #4987:
URL: https://github.com/apache/ozone/pull/4987#discussion_r1270212769


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -229,15 +229,42 @@ public Response put(
       Map<String, String> customMetadata =
           getCustomMetadataFromHeaders(headers.getRequestHeaders());
 
+      long signedChunksLength = -1;
+      boolean signed = false;
       if ("STREAMING-AWS4-HMAC-SHA256-PAYLOAD"
           .equals(headers.getHeaderString("x-amz-content-sha256"))) {
+        signed = true;
         body = new SignedChunksInputStream(body);
+        //signedChunksLength = body2.readHeader();
+        String decodedContentLength = headers.
+            getHeaderString("x-amz-decoded-content-length");
+        if (decodedContentLength != null) {
+          signedChunksLength = Long.parseLong(decodedContentLength);
+        } else {
+          OS3Exception os3Exception = newError(S3ErrorTable.INVALID_REQUEST,
+              keyPath);
+          os3Exception.setErrorMessage("An error occurred (Missing Header) " +
+              "when calling the PutObject/MPU PartUpload operation: " +
+              " Necessary header 'x-amz-decoded-content-length' missing");
+          throw os3Exception;

Review Comment:
   Thanks for reviewing my patch. Yes that makes sense. I had missed that 
class. Thank you for catching it.



-- 
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]

Reply via email to