rich7420 commented on code in PR #11870:
URL: https://github.com/apache/ozone/pull/11870#discussion_r4457544189
##########
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:
This behavior already exists in
[HDDS-9654](https://github.com/apache/ozone/pull/5565), though I couldn’t find
why zero is accepted. This PR leaves it unchanged and only rejects `partNumber`
combined with `Range`.
--
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]