This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push: new 55c9faa7f6 Fix check order 55c9faa7f6 is described below commit 55c9faa7f6f8cac79ceb7db09992ca6cb6477e98 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 41c8bb8a74..42f2a9565c 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -2082,6 +2082,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 @@ -2089,11 +2094,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