diff --git a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java index b5eada90373f..5a6d469be7a1 100644 --- a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java +++ b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java @@ -55,7 +55,7 @@ public void testRangeHandlingDefinedMethods() throws Exception { String rangeHeader = "bytes=0-10"; // Get and Head - requestHeaders.computeIfAbsent("Range", (k) -> List.of(rangeHeader)); + requestHeaders.put("Range",List.of(rangeHeader)); int rc = getUrl(path, responseBody, requestHeaders, responseHeaders); Assert.assertEquals("Range requests is turn on, SC_PARTIAL_CONTENT of GET is expected", HttpServletResponse.SC_PARTIAL_CONTENT, rc); @@ -90,7 +90,7 @@ public void testUnsupportedRangeUnit() throws Exception { String rangeHeader = "Chars=0-10"; // Get and Head - requestHeaders.computeIfAbsent("Range", (k) -> List.of(rangeHeader)); + requestHeaders.put("Range",List.of(rangeHeader)); int rc = getUrl(path, responseBody, requestHeaders, responseHeaders); Assert.assertEquals( "RFC 9110 - 14.2: An origin server MUST ignore a Range header field that contains a range unit it does not understand. `Chars` is not a understandable RangeUnit, SC_OK is expected",