chungen0126 commented on code in PR #10196:
URL: https://github.com/apache/ozone/pull/10196#discussion_r3193805239


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -198,12 +199,18 @@ Response handlePutRequest(ObjectRequestContext context, 
String keyPath, InputStr
     final long startNanos = context.getStartNanos();
 
     String copyHeader = null;
+    FileBackedOutputStream spooledBody = null;
     MultiDigestInputStream multiDigestInputStream = null;
     try {
       OzoneVolume volume = context.getVolume();
       OzoneBucket bucket = context.getBucket();
       final String lengthHeader = 
getHeaders().getHeaderString(HttpHeaders.CONTENT_LENGTH);
       long length = lengthHeader != null ? Long.parseLong(lengthHeader) : 0;
+      if (lengthHeader == null && body != null) {

Review Comment:
   Regarding S3, we should also consider the scenario where the Content-Length 
header is absent, but the x-amz-decoded-content-length header is provided. In 
this case, since we already know the exact size of the payload, we wouldn't 
need to manually calculate the upload length. See 
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html 
   
   > For all requests, you must include the x-amz-decoded-content-length 
header, specifying the size of the object in bytes.



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