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

rmaucher 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 9e6126ee48 Avoid any init parameter updates when conflicts are found 
for filters
9e6126ee48 is described below

commit 9e6126ee48515c20fa172e1ce144600f14b8d81b
Author: remm <[email protected]>
AuthorDate: Thu May 21 09:57:59 2026 +0200

    Avoid any init parameter updates when conflicts are found for filters
    
    This was already done for Servlets.
---
 java/org/apache/catalina/core/ApplicationFilterRegistration.java | 6 ++++--
 webapps/docs/changelog.xml                                       | 5 +++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationFilterRegistration.java 
b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
index ecdadf5e6a..38153ccad6 100644
--- a/java/org/apache/catalina/core/ApplicationFilterRegistration.java
+++ b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
@@ -198,8 +198,10 @@ public class ApplicationFilterRegistration implements 
FilterRegistration.Dynamic
 
         // Have to add in a separate loop since spec requires no updates at all
         // if there is an issue
-        for (Map.Entry<String,String> entry : initParameters.entrySet()) {
-            setInitParameter(entry.getKey(), entry.getValue());
+        if (conflicts.isEmpty()) {
+            for (Map.Entry<String,String> entry : initParameters.entrySet()) {
+                setInitParameter(entry.getKey(), entry.getValue());
+            }
         }
 
         return conflicts;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 90d09a0887..07e4a5efd7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -136,6 +136,11 @@
         Improve robustness on using <code>Pipeline.setBasic</code> on a running
         pipeline. (remm)
       </fix>
+      <fix>
+        Avoid any init parameter updates when conflicts are found for filters,
+        similar to what is done for servlets, as required by the servlet
+        specification. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


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

Reply via email to