Gargi-jais11 commented on code in PR #11870:
URL: https://github.com/apache/ozone/pull/11870#discussion_r4465440461
##########
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 do reached out to few folks but couldn't gather any information why
partNumber=0 should not be rejected.
So I agree with @chungen0126 we should reject partNumber = 0 as done in AWS
s3.
@rich7420 Let's do this change as well in the PR and mention this in the PR
description as well.
--
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]