This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 693b6611f2 Fix check order 693b6611f2 is described below commit 693b6611f2bd85d7f6219e1a9ae6d82b6bb12122 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 02ba6dc02f..cc7fc23f69 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -2205,6 +2205,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 @@ -2212,11 +2217,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