camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] camel git commit: CAMEL-9052: HttpHeaderFilterStrategy should filter any Camel header on consumer side as well
Date Wed, 05 Aug 2015 09:36:57 GMT
CAMEL-9052: HttpHeaderFilterStrategy should filter any Camel header on consumer side as well


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4803af14
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4803af14
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4803af14

Branch: refs/heads/master
Commit: 4803af14b8851f05987f822e446232cce5311a65
Parents: 7099038
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Aug 5 11:20:05 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Aug 5 11:44:25 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/component/ahc/HttpHeaderFilterStrategy.java   | 1 +
 .../camel/component/ahc/HttpHeaderFilterStrategyTest.java      | 6 ++++--
 .../camel/component/http4/HttpHeaderFilterStrategyTest.java    | 4 ++--
 .../component/netty/http/NettyHttpHeaderFilterStrategy.java    | 1 +
 .../component/netty4/http/NettyHttpHeaderFilterStrategy.java   | 1 +
 5 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4803af14/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategy.java
b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategy.java
index 6f3786b..acf1a35 100644
--- a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategy.java
+++ b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategy.java
@@ -48,6 +48,7 @@ public class HttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
         // filter headers begin with "Camel" or "org.apache.camel"
         // must ignore case for Http based transports
         setOutFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
+        setInFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/4803af14/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
index adfe3ff..16d2a48 100644
--- a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
+++ b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
@@ -62,8 +62,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertFalse(filter.applyFilterToExternalHeaders("warning", "199 Miscellaneous warning",
exchange));
         assertFalse(filter.applyFilterToExternalHeaders("Warning", "199 Miscellaneous warning",
exchange));
 
-        assertFalse(filter.applyFilterToExternalHeaders("CamelHeader", "test", exchange));
-        assertFalse(filter.applyFilterToExternalHeaders("org.apache.camel.header", "test",
exchange));
+        // any Camel header should be filtered
+        assertTrue(filter.applyFilterToExternalHeaders("CamelHeader", "test", exchange));
+        assertTrue(filter.applyFilterToExternalHeaders("org.apache.camel.header", "test",
exchange));
 
         assertFalse(filter.applyFilterToExternalHeaders("notFilteredHeader", "test", exchange));
 
@@ -96,6 +97,7 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertTrue(filter.applyFilterToCamelHeaders("warning", "199 Miscellaneous warning",
exchange));
         assertTrue(filter.applyFilterToCamelHeaders("Warning", "199 Miscellaneous warning",
exchange));
 
+        // any Camel header should be filtered
         assertTrue(filter.applyFilterToCamelHeaders("CamelHeader", "test", exchange));
         assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4803af14/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpHeaderFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpHeaderFilterStrategyTest.java
b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpHeaderFilterStrategyTest.java
index 3b7189e..803e05f 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpHeaderFilterStrategyTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpHeaderFilterStrategyTest.java
@@ -99,8 +99,8 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertTrue(filter.applyFilterToCamelHeaders("Warning", "199 Miscellaneous warning",
exchange));
 
         // any Camel header should be filtered
-        assertTrue(filter.applyFilterToExternalHeaders("CamelHeader", "test", exchange));
-        assertTrue(filter.applyFilterToExternalHeaders("org.apache.camel.header", "test",
exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("CamelHeader", "test", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
 
         assertFalse(filter.applyFilterToCamelHeaders("notFilteredHeader", "test", exchange));
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4803af14/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategy.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategy.java
index 56812a4..d45e2f1 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategy.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategy.java
@@ -49,5 +49,6 @@ public class NettyHttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
         // filter headers begin with "Camel" or "org.apache.camel"
         // must ignore case for Http based transports
         setOutFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
+        setInFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/4803af14/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHeaderFilterStrategy.java
b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHeaderFilterStrategy.java
index 741af96..c02cb3d 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHeaderFilterStrategy.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpHeaderFilterStrategy.java
@@ -49,5 +49,6 @@ public class NettyHttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
         // filter headers begin with "Camel" or "org.apache.camel"
         // must ignore case for Http based transports
         setOutFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
+        setInFilterPattern("(?i)(Camel|org\\.apache\\.camel)[\\.|a-z|A-z|0-9]*");
     }
 }


Mime
View raw message