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

markt-asf 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 06866e78ba Fix back-port
06866e78ba is described below

commit 06866e78ba3fc69caaa9505cceaa543999a05c59
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 29 19:32:22 2026 +0000

    Fix back-port
---
 java/org/apache/catalina/valves/ParameterLimitValve.java | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/ParameterLimitValve.java 
b/java/org/apache/catalina/valves/ParameterLimitValve.java
index 49e970750e..49ba863acf 100644
--- a/java/org/apache/catalina/valves/ParameterLimitValve.java
+++ b/java/org/apache/catalina/valves/ParameterLimitValve.java
@@ -318,8 +318,8 @@ public class ParameterLimitValve extends ValveBase {
         // matching pattern. The map is in configuration order, so when several
         // patterns match, the first configured matching pattern wins.
         for (UrlPatternLimit urlPatternLimit : 
urlPatternLimitsSnapshot.values()) {
-            if (urlPatternLimit.pattern().matcher(requestURI).matches()) {
-                Integer[] limits = urlPatternLimit.limits();
+            if (urlPatternLimit.pattern.matcher(requestURI).matches()) {
+                Integer[] limits = urlPatternLimit.limits;
                 // maxParameterCount should always be present
                 request.setMaxParameterCount(limits[0].intValue());
                 if (limits[1] != null) {
@@ -337,11 +337,13 @@ public class ParameterLimitValve extends ValveBase {
 
     /**
      * The compiled URL pattern and the limits to apply to the requests that 
match it.
-     *
-     * @param pattern The compiled URL pattern
-     * @param limits  The maxParameterCount, maxPartCount and 
maxPartHeaderSize limits, the latter two being
-     *                    {@code null} if not configured
      */
-    private record UrlPatternLimit(Pattern pattern, Integer[] limits) {
+    private static class UrlPatternLimit {
+        final Pattern pattern;
+        final Integer[] limits;
+        UrlPatternLimit(Pattern pattern, Integer[] limits) {
+            this.pattern = pattern;
+            this.limits = limits;
+        }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to