This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.18.x by this push:
new 6736bc0a6f13 CAMEL-23379: camel-core - DefaultHeaderFilterStrategy
should be lower-case by default (#22823)
6736bc0a6f13 is described below
commit 6736bc0a6f1313904000582749f5cfa6b2380b5e
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Apr 29 14:12:48 2026 +0200
CAMEL-23379: camel-core - DefaultHeaderFilterStrategy should be lower-case
by default (#22823)
---
.../catalog/beans/DefaultHeaderFilterStrategy.json | 2 +-
.../camel/impl/DefaultHeaderFilterStrategyTest.java | 4 +++-
.../camel/bean/DefaultHeaderFilterStrategy.json | 2 +-
.../camel/support/DefaultHeaderFilterStrategy.java | 20 ++++++++++++--------
4 files changed, 17 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 3e97b6242d38..8fdf3c0c0e50 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.18.3-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 3e97b6242d38..8fdf3c0c0e50 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.18.3-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.
*/