camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cepo...@apache.org
Subject git commit: Fix for https://issues.apache.org/jira/browse/CAMEL-6185 - http4 component should always filter 'host' header
Date Mon, 04 Nov 2013 20:56:56 GMT
Updated Branches:
  refs/heads/master 41ce3c6fd -> cfe5ddd56


Fix for https://issues.apache.org/jira/browse/CAMEL-6185 - http4 component should always filter
'host' header


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

Branch: refs/heads/master
Commit: cfe5ddd5638f7acb3d0d0d9b1de806f2058e8415
Parents: 41ce3c6
Author: Christian Posta <christian.posta@gmail.com>
Authored: Wed Sep 25 11:33:53 2013 -0700
Committer: Christian Posta <christian.posta@gmail.com>
Committed: Mon Nov 4 13:56:20 2013 -0700

----------------------------------------------------------------------
 .../component/ahc/HttpHeaderFilterStrategy.java |   1 +
 .../ahc/HttpHeaderFilterStrategyTest.java       | 108 ++++++++++++++++++
 .../http/HttpHeaderFilterStrategy.java          |   1 +
 .../http/HttpHeaderFilterStrategyTest.java      |   6 +
 .../http4/HttpHeaderFilterStrategy.java         |   1 +
 .../http4/HttpHeaderFilterStrategyTest.java     |   6 +
 .../http/NettyHttpHeaderFilterStrategy.java     |   1 +
 .../http/NettyHttpHeaderFilterStrategyTest.java | 109 +++++++++++++++++++
 8 files changed, 233 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/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 64a6378..6f3786b 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
@@ -30,6 +30,7 @@ public class HttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
     protected void initialize() {
         getOutFilter().add("content-length");
         getOutFilter().add("content-type");
+        getOutFilter().add("host");
         // Add the filter for the Generic Message header
         // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
         getOutFilter().add("cache-control");

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/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
new file mode 100644
index 0000000..adfe3ff
--- /dev/null
+++ b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/HttpHeaderFilterStrategyTest.java
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.ahc;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DefaultExchange;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
+
+    private HttpHeaderFilterStrategy filter;
+    private Exchange exchange;
+
+    @Before
+    public void setUp() {
+        filter = new HttpHeaderFilterStrategy();
+        exchange = new DefaultExchange(new DefaultCamelContext());
+    }
+
+    @Test
+    public void applyFilterToExternalHeaders() {
+        assertFalse(filter.applyFilterToExternalHeaders("content-length", 10, exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Content-Length", 10, exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("content-type", "text/xml", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Content-Type", "text/xml", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("cache-control", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Cache-Control", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("connection", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Connection", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("date", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Data", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("pragma", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Pragma", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("trailer", "Max-Forwards", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Trailer", "Max-Forwards", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("transfer-encoding", "chunked", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Transfer-Encoding", "chunked", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("upgrade", "HTTP/2.0", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Upgrade", "HTTP/2.0", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("via", "1.1 nowhere.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Via", "1.1 nowhere.com", exchange));
+        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));
+
+        assertFalse(filter.applyFilterToExternalHeaders("notFilteredHeader", "test", exchange));
+
+        assertFalse(filter.applyFilterToExternalHeaders("host", "dummy.host.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Host", "dummy.host.com", exchange));
+    }
+
+    @Test
+    public void applyFilterToCamelHeaders() {
+        assertTrue(filter.applyFilterToCamelHeaders("content-length", 10, exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Content-Length", 10, exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("content-type", "text/xml", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Content-Type", "text/xml", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("cache-control", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Cache-Control", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("connection", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Connection", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("date", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Date", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("pragma", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Pragma", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("trailer", "Max-Forwards", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Trailer", "Max-Forwards", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("transfer-encoding", "chunked", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Transfer-Encoding", "chunked", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("upgrade", "HTTP/2.0", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Upgrade", "HTTP/2.0", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("via", "1.1 nowhere.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Via", "1.1 nowhere.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("warning", "199 Miscellaneous warning",
exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Warning", "199 Miscellaneous warning",
exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("CamelHeader", "test", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
+
+        assertFalse(filter.applyFilterToCamelHeaders("notFilteredHeader", "test", exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("host", "dummy.host.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Host", "dummy.host.com", exchange));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
index 0b97594..8c7e265 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpHeaderFilterStrategy.java
@@ -30,6 +30,7 @@ public class HttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
     protected void initialize() {
         getOutFilter().add("content-length");
         getOutFilter().add("content-type");
+        getOutFilter().add("host");
         // Add the filter for the Generic Message header
         // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
         getOutFilter().add("cache-control");

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/components/camel-http/src/test/java/org/apache/camel/component/http/HttpHeaderFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpHeaderFilterStrategyTest.java
b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpHeaderFilterStrategyTest.java
index 7338a8d..f885fed 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpHeaderFilterStrategyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpHeaderFilterStrategyTest.java
@@ -66,6 +66,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertFalse(filter.applyFilterToExternalHeaders("org.apache.camel.header", "test",
exchange));
 
         assertFalse(filter.applyFilterToExternalHeaders("notFilteredHeader", "test", exchange));
+
+        assertFalse(filter.applyFilterToExternalHeaders("host", "dummy.host.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Host", "dummy.host.com", exchange));
     }
 
     @Test
@@ -97,6 +100,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
 
         assertFalse(filter.applyFilterToCamelHeaders("notFilteredHeader", "test", exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("host", "dummy.host.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Host", "dummy.host.com", exchange));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpHeaderFilterStrategy.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpHeaderFilterStrategy.java
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpHeaderFilterStrategy.java
index 77a255e..906bf29 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpHeaderFilterStrategy.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpHeaderFilterStrategy.java
@@ -30,6 +30,7 @@ public class HttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
     protected void initialize() {
         getOutFilter().add("content-length");
         getOutFilter().add("content-type");
+        getOutFilter().add("host");
         // Add the filter for the Generic Message header
         // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
         getOutFilter().add("cache-control");

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/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 f0a3a93..0c69b2a 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
@@ -66,6 +66,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertFalse(filter.applyFilterToExternalHeaders("org.apache.camel.header", "test",
exchange));
 
         assertFalse(filter.applyFilterToExternalHeaders("notFilteredHeader", "test", exchange));
+
+        assertFalse(filter.applyFilterToExternalHeaders("host", "dummy.host.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Host", "dummy.host.com", exchange));
     }
 
     @Test
@@ -97,6 +100,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
         assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
 
         assertFalse(filter.applyFilterToCamelHeaders("notFilteredHeader", "test", exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("host", "dummy.host.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Host", "dummy.host.com", exchange));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/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 a135eeb..56812a4 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
@@ -31,6 +31,7 @@ public class NettyHttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy
{
     protected void initialize() {
         getOutFilter().add("content-length");
         getOutFilter().add("content-type");
+        getOutFilter().add("host");
         // Add the filter for the Generic Message header
         // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
         getOutFilter().add("cache-control");

http://git-wip-us.apache.org/repos/asf/camel/blob/cfe5ddd5/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyTest.java
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyTest.java
new file mode 100644
index 0000000..61d32b9
--- /dev/null
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyTest.java
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.netty.http;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DefaultExchange;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>
+ */
+public class NettyHttpHeaderFilterStrategyTest {
+    
+    private NettyHttpHeaderFilterStrategy filter;
+    private Exchange exchange;
+    
+    @Before
+    public void setUp() {
+        filter = new NettyHttpHeaderFilterStrategy();
+        exchange = new DefaultExchange(new DefaultCamelContext());
+    }
+
+    @Test
+    public void applyFilterToExternalHeaders() {
+        assertFalse(filter.applyFilterToExternalHeaders("content-length", 10, exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Content-Length", 10, exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("content-type", "text/xml", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Content-Type", "text/xml", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("cache-control", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Cache-Control", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("connection", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Connection", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("date", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Data", "close", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("pragma", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Pragma", "no-cache", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("trailer", "Max-Forwards", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Trailer", "Max-Forwards", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("transfer-encoding", "chunked", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Transfer-Encoding", "chunked", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("upgrade", "HTTP/2.0", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Upgrade", "HTTP/2.0", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("via", "1.1 nowhere.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Via", "1.1 nowhere.com", exchange));
+        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));
+
+        assertFalse(filter.applyFilterToExternalHeaders("notFilteredHeader", "test", exchange));
+
+        assertFalse(filter.applyFilterToExternalHeaders("host", "dummy.host.com", exchange));
+        assertFalse(filter.applyFilterToExternalHeaders("Host", "dummy.host.com", exchange));
+    }
+
+    @Test
+    public void applyFilterToCamelHeaders() {
+        assertTrue(filter.applyFilterToCamelHeaders("content-length", 10, exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Content-Length", 10, exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("content-type", "text/xml", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Content-Type", "text/xml", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("cache-control", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Cache-Control", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("connection", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Connection", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("date", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Date", "close", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("pragma", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Pragma", "no-cache", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("trailer", "Max-Forwards", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Trailer", "Max-Forwards", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("transfer-encoding", "chunked", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Transfer-Encoding", "chunked", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("upgrade", "HTTP/2.0", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Upgrade", "HTTP/2.0", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("via", "1.1 nowhere.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Via", "1.1 nowhere.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("warning", "199 Miscellaneous warning",
exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Warning", "199 Miscellaneous warning",
exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("CamelHeader", "test", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("org.apache.camel.header", "test", exchange));
+
+        assertFalse(filter.applyFilterToCamelHeaders("notFilteredHeader", "test", exchange));
+
+        assertTrue(filter.applyFilterToCamelHeaders("host", "dummy.host.com", exchange));
+        assertTrue(filter.applyFilterToCamelHeaders("Host", "dummy.host.com", exchange));
+    }
+}


Mime
View raw message