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

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


The following commit(s) were added to refs/heads/main by this push:
     new 4aab786a5b4e CAMEL-22353: camel-undertow - Skip headers which has 
invalid chars in names.
4aab786a5b4e is described below

commit 4aab786a5b4ef684b764aad8343c3ebb09b79b21
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Dec 27 19:34:21 2025 +0100

    CAMEL-22353: camel-undertow - Skip headers which has invalid chars in names.
---
 .../undertow/UndertowHeaderFilterStrategy.java     | 27 +++++++++-------------
 .../ROOT/pages/camel-4x-upgrade-guide-4_17.adoc    |  5 ++++
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHeaderFilterStrategy.java
 
b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHeaderFilterStrategy.java
index 75e3de61a370..23c0d894d7d7 100644
--- 
a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHeaderFilterStrategy.java
+++ 
b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHeaderFilterStrategy.java
@@ -16,27 +16,22 @@
  */
 package org.apache.camel.component.undertow;
 
-import org.apache.camel.support.DefaultHeaderFilterStrategy;
-import org.apache.camel.support.http.HttpUtil;
+import org.apache.camel.Exchange;
+import org.apache.camel.http.base.HttpHeaderFilterStrategy;
 
-/**
- *
- * @deprecated use {@link org.apache.camel.http.base.HttpHeaderFilterStrategy} 
instead.
- */
-public class UndertowHeaderFilterStrategy extends DefaultHeaderFilterStrategy {
+public class UndertowHeaderFilterStrategy extends HttpHeaderFilterStrategy {
 
     public UndertowHeaderFilterStrategy() {
         initialize();
     }
 
-    protected void initialize() {
-        HttpUtil.addCommonFilters(getOutFilter());
-
-        setLowerCase(true);
-
-        // filter headers begin with "Camel" or "org.apache.camel"
-        // must ignore case for Http based transports
-        setOutFilterStartsWith(CAMEL_FILTER_STARTS_WITH);
-        setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH);
+    @Override
+    public boolean applyFilterToExternalHeaders(String headerName, Object 
headerValue, Exchange exchange) {
+        boolean skip = io.undertow.util.HttpString.tryFromString(headerName) 
== null;
+        if (skip) {
+            // skip all not valid headers by undertow rules
+            return true;
+        }
+        return super.applyFilterToExternalHeaders(headerName, headerValue, 
exchange);
     }
 }
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_17.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_17.adoc
index 1985bea645cd..5b85ed11717e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_17.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_17.adoc
@@ -70,6 +70,11 @@ Disabling virtual threads by setting system property 
`org.infinispan.threads.vir
 
 Upgraded to Tika v3, and removed `textMain` from `tikaParseOutputFormat` 
option.
 
+=== camel-undertow
+
+This component will not skip headers that has invalid characters in key names 
(UT10052), implemented
+in the `UndertowHeaderFilterStrategy` class.
+
 === Component deprecation
 
 The `camel-stomp` component is deprecated.

Reply via email to