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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -398,6 +393,14 @@ Response handleGetRequest(ObjectRequestContext context, 
String keyPath)
 
       context.setAction(S3GAction.GET_KEY);
 
+      String rangeHeaderVal = getHeaders().getHeaderString(RANGE_HEADER);
+      
validatePartNumberAndRange(queryParams().containsKey(QueryParams.PART_NUMBER), 
rangeHeaderVal, keyPath);
+      final int partNumber = queryParams().getInt(QueryParams.PART_NUMBER, 0);
+      // A negative part number is not a valid part; reject it as 
InvalidArgument.
+      if (partNumber < 0) {
+        throw newError(INVALID_ARGUMENT, String.valueOf(partNumber));
+      }

Review Comment:
   I'm not sure if we've discussed this before, but according to AWS S3 rules, 
partNumber = 0 results in InvalidArgument. However, Ozone is designed to read 
the entire object in this case. I was wondering if @Gargi-jais11 knows any 
details?



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