This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new d6c4cf213b Fix check order
d6c4cf213b is described below

commit d6c4cf213bc40762b7e19d1a78fa08b39b73b1d9
Author: remm <r...@apache.org>
AuthorDate: Wed Dec 11 19:07:52 2024 +0100

    Fix check order
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 2b4b7e4145..64ce656248 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2141,6 +2141,11 @@ public class DefaultServlet extends HttpServlet {
     protected boolean checkIfMatch(HttpServletRequest request, 
HttpServletResponse response, WebResource resource)
             throws IOException {
 
+        boolean conditionSatisfied = false;
+        Enumeration<String> headerValues = request.getHeaders("If-Match");
+        if (!headerValues.hasMoreElements()) {
+            return true;
+        }
         String resourceETag = generateETag(resource);
         if (resourceETag == null) {
             // if a current representation for the target resource is not 
present
@@ -2148,11 +2153,6 @@ public class DefaultServlet extends HttpServlet {
             return false;
         }
 
-        boolean conditionSatisfied = false;
-        Enumeration<String> headerValues = request.getHeaders("If-Match");
-        if (!headerValues.hasMoreElements()) {
-            return true;
-        }
         boolean hasAsteriskValue = false;// check existence of special header 
value '*'
         int headerCount = 0;
         while (headerValues.hasMoreElements() && !conditionSatisfied) {


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

Reply via email to