Gargi-jais11 commented on code in PR #11612:
URL: https://github.com/apache/ozone/pull/11612#discussion_r4310719697
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -651,7 +652,14 @@ public Response head(
auditReadSuccess(context.getAction());
return conditionalResponse;
}
- // TODO: return the specified range bytes of this object.
+
+ String rangeHeaderVal = getHeaders().getHeaderString(RANGE_HEADER);
+ if (rangeHeaderVal != null) {
+ rangeHeader = RangeHeaderParserUtil.parseRangeHeader(rangeHeaderVal,
key.getDataSize());
+ if (rangeHeader.isInValidRange()) {
+ throw newError(S3ErrorTable.INVALID_RANGE, rangeHeaderVal);
+ }
Review Comment:
nit: InvalidRange here goes to the generic catch, which skips
`updateHeadKeyFailureStats`, so these HEAD OBJECT failures are not counted in
metrics.
Please update the failure metric in that catch too
--
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]