rich7420 commented on code in PR #11693:
URL: https://github.com/apache/ozone/pull/11693#discussion_r4359322938


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/util/TestRangeHeaderParserUtil.java:
##########
@@ -133,4 +135,32 @@ public void testRangeWithoutStartAndEndIsIgnored() {
     assertFalse(rangeHeader.isInValidRange());
   }
 
+  @Test
+  public void testRangeWithLongMaxValue() {
+    RangeHeader rangeHeader = 
RangeHeaderParserUtil.parseRangeHeader("bytes=0-" + Long.MAX_VALUE, 10);
+    assertEquals(0, rangeHeader.getStartOffset());
+    assertEquals(9, rangeHeader.getEndOffset());
+    assertFalse(rangeHeader.isReadFull());
+    assertFalse(rangeHeader.isInValidRange());
+  }
+
+  // 9223372036854775808 is Long.MAX_VALUE + 1
+  @ParameterizedTest
+  @ValueSource(strings = {
+      "bytes=0-9223372036854775808",
+      "bytes=0-99999999999999999999",

Review Comment:
   nit: these overflow cases all start at 0, so a fallback that kept the parsed 
start would still pass. Maybe add a non-zero start:
   ```suggestion
         "bytes=0-99999999999999999999",
         "bytes=5-99999999999999999999",
   ```
   



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