rmaucher commented on code in PR #796:
URL: https://github.com/apache/tomcat/pull/796#discussion_r1881736644


##########
java/org/apache/catalina/servlets/DefaultServlet.java:
##########
@@ -726,10 +727,79 @@ protected void doDelete(HttpServletRequest req, 
HttpServletResponse resp) throws
      */
     protected boolean checkIfHeaders(HttpServletRequest request, 
HttpServletResponse response, WebResource resource)
             throws IOException {
+        String ifMatchHeader = request.getHeader("If-Match");
+        String ifUnmodifiedSinceHeader = 
request.getHeader("If-Unmodified-Since");
+        String ifNoneMatchHeader = request.getHeader("If-None-Match");
+        String ifModifiedSinceHeader = request.getHeader("If-Modified-Since");
+        String ifRangeHeader = request.getHeader("If-Range");
+        String rangeHeader = request.getHeader("Range");
 
-        return checkIfMatch(request, response, resource) && 
checkIfModifiedSince(request, response, resource) &&
-                checkIfNoneMatch(request, response, resource) && 
checkIfUnmodifiedSince(request, response, resource);
-
+        // RFC9110 #13.3.2 defines preconditions evaluation order
+        int next = 1;
+        while (next < 6) {

Review Comment:
   Ok, I see the origin of the weird code now. Thanks for the extra test, the 
old code was not accurate about the order.



-- 
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: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to