You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/04/29 08:53:59 UTC

(camel) branch hs created (now 24fa3e36792a)

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

davsclaus pushed a change to branch hs
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 24fa3e36792a CAMEL-23379: camel-core - DefaultHeaderFilterStrategy should be lower-case by default

This branch includes the following new commits:

     new 24fa3e36792a CAMEL-23379: camel-core - DefaultHeaderFilterStrategy should be lower-case by default

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: CAMEL-23379: camel-core - DefaultHeaderFilterStrategy should be lower-case by default

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch hs
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 24fa3e36792aa86982abf9fe4dbf33f30bc3703d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Apr 29 10:53:44 2026 +0200

    CAMEL-23379: camel-core - DefaultHeaderFilterStrategy should be lower-case by default
---
 .../catalog/beans/DefaultHeaderFilterStrategy.json   |  2 +-
 .../camel/impl/DefaultHeaderFilterStrategyTest.java  |  4 +++-
 .../camel/bean/DefaultHeaderFilterStrategy.json      |  2 +-
 .../camel/support/DefaultHeaderFilterStrategy.java   | 20 ++++++++++++--------
 .../ROOT/pages/camel-4x-upgrade-guide-4_21.adoc      |  4 ++++
 5 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/DefaultHeaderFilterStrategy.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/DefaultHeaderFilterStrategy.json
index c2e98c66a851..67a8b3069327 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/DefaultHeaderFilterStrategy.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/DefaultHeaderFilterStrategy.json
@@ -10,7 +10,7 @@
     "groupId": "org.apache.camel",
     "artifactId": "camel-support",
     "version": "4.21.0-SNAPSHOT",
-    "properties": { "inFilter": { "index": 0, "kind": "property", "displayName": "In Filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the in direction filter set. The in direction is referred to copying headers from an external message to a Camel message. Multiple patterns can be separated by comma" }, "outFilter": { "index": 1, "kind": "property", "displayName": "Out Filter", "req [...]
+    "properties": { "inFilter": { "index": 0, "kind": "property", "displayName": "In Filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the in direction filter set. The in direction is referred to copying headers from an external message to a Camel message. Multiple patterns can be separated by comma" }, "outFilter": { "index": 1, "kind": "property", "displayName": "Out Filter", "req [...]
   }
 }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
index 5e26dfeca8c2..73324480c25b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultHeaderFilterStrategyTest.java
@@ -37,8 +37,9 @@ public class DefaultHeaderFilterStrategyTest extends ContextTestSupport {
         comp.setAllowNullValues(true);
         assertTrue(comp.isAllowNullValues());
 
-        comp.setLowerCase(true);
         assertTrue(comp.isLowerCase());
+        comp.setLowerCase(false);
+        assertFalse(comp.isLowerCase());
 
         assertTrue(comp.isCaseInsensitive());
         comp.setCaseInsensitive(false);
@@ -78,6 +79,7 @@ public class DefaultHeaderFilterStrategyTest extends ContextTestSupport {
     @Test
     public void testInFilterCaseSensitive() {
         DefaultHeaderFilterStrategy comp = new DefaultHeaderFilterStrategy();
+        comp.setLowerCase(false);
         comp.setCaseInsensitive(false);
 
         Set<String> set = new HashSet<>();
diff --git a/core/camel-support/src/generated/resources/META-INF/services/org/apache/camel/bean/DefaultHeaderFilterStrategy.json b/core/camel-support/src/generated/resources/META-INF/services/org/apache/camel/bean/DefaultHeaderFilterStrategy.json
index c2e98c66a851..67a8b3069327 100644
--- a/core/camel-support/src/generated/resources/META-INF/services/org/apache/camel/bean/DefaultHeaderFilterStrategy.json
+++ b/core/camel-support/src/generated/resources/META-INF/services/org/apache/camel/bean/DefaultHeaderFilterStrategy.json
@@ -10,7 +10,7 @@
     "groupId": "org.apache.camel",
     "artifactId": "camel-support",
     "version": "4.21.0-SNAPSHOT",
-    "properties": { "inFilter": { "index": 0, "kind": "property", "displayName": "In Filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the in direction filter set. The in direction is referred to copying headers from an external message to a Camel message. Multiple patterns can be separated by comma" }, "outFilter": { "index": 1, "kind": "property", "displayName": "Out Filter", "req [...]
+    "properties": { "inFilter": { "index": 0, "kind": "property", "displayName": "In Filter", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the in direction filter set. The in direction is referred to copying headers from an external message to a Camel message. Multiple patterns can be separated by comma" }, "outFilter": { "index": 1, "kind": "property", "displayName": "Out Filter", "req [...]
   }
 }
 
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultHeaderFilterStrategy.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultHeaderFilterStrategy.java
index f8ac8f3e21c7..88fabe5f1932 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultHeaderFilterStrategy.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultHeaderFilterStrategy.java
@@ -68,16 +68,16 @@ public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
     private Pattern outFilterPattern;
     private String[] outFilterStartsWith;
 
-    @Metadata(label = "advanced", defaultValue = "false",
-              description = "Whether header names should be converted to lower case before checking it with the filter Set."
+    @Metadata(label = "advanced", defaultValue = "true",
+              description = "Whether header names should be converted to lower case before checking it with the filter Set. This ensures that all variations of header names will be taken into account."
                             + " It does not affect filtering using regular expression pattern.")
-    private boolean lowerCase;
+    private boolean lowerCase = true;
     @Metadata(label = "advanced", defaultValue = "false",
               description = "Whether to allow null values. By default a header is skipped if its value is null. Setting this to true will preserve the header.")
     private boolean allowNullValues;
     @Metadata(label = "advanced", defaultValue = "true",
               description = "Sets the caseInsensitive property which is a boolean to determine whether header names should be case insensitive"
-                            + " when checking it with the filter set. It does not affect filtering using regular expression pattern.")
+                            + " when checking it with the filter set. This ensures that all variations of header names will be taken into account. It does not affect filtering using regular expression pattern.")
     private boolean caseInsensitive = true;
     @Metadata(label = "advanced", defaultValue = "true",
               description = "Sets what to do when a pattern or filter set is matched."
@@ -250,7 +250,8 @@ public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
 
     /**
      * Gets the isLowercase property which is a boolean to determine whether header names should be converted to lower
-     * case before checking it with the filter Set. It does not affect filtering using regular expression pattern.
+     * case before checking it with the filter Set. This ensures that all variations of header names will be taken into
+     * account. It does not affect filtering using regular expression pattern.
      */
     public boolean isLowerCase() {
         return lowerCase;
@@ -258,7 +259,8 @@ public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
 
     /**
      * Sets the isLowercase property which is a boolean to determine whether header names should be converted to lower
-     * case before checking it with the filter Set. It does not affect filtering using regular expression pattern.
+     * case before checking it with the filter Set. This ensures that all variations of header names will be taken into
+     * account. It does not affect filtering using regular expression pattern.
      */
     public void setLowerCase(boolean value) {
         lowerCase = value;
@@ -266,7 +268,8 @@ public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
 
     /**
      * Gets the caseInsensitive property which is a boolean to determine whether header names should be case insensitive
-     * when checking it with the filter set. It does not affect filtering using regular expression pattern.
+     * when checking it with the filter set. This ensures that all variations of header names will be taken into
+     * account.. It does not affect filtering using regular expression pattern.
      *
      * @return <tt>true</tt> if header names is case insensitive.
      */
@@ -276,7 +279,8 @@ public class DefaultHeaderFilterStrategy implements HeaderFilterStrategy {
 
     /**
      * Sets the caseInsensitive property which is a boolean to determine whether header names should be case insensitive
-     * when checking it with the filter set. It does not affect filtering using regular expression pattern,
+     * when checking it with the filter set. This ensures that all variations of header names will be taken into
+     * account.. It does not affect filtering using regular expression pattern,
      *
      * @param caseInsensitive <tt>true</tt> if header names is case insensitive.
      */
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
index 94dd9578a972..bf95ee761b3c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
@@ -13,6 +13,10 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] page for details.
 
 == Upgrading Camel 4.20 to 4.21
 
+=== camel-core
+
+The `org.apache.camel.support.DefaultHeaderFilterStrategy` changed default setting for lowercase from `false` to `true`.
+
 === camel-yaml-dsl
 
 A new canonical JSON Schema variant (`camelYamlDsl-canonical.json`) has been added alongside the existing classic