Repository: camel
Updated Branches:
  refs/heads/master 8fd0711af -> 77b4593ee


CAMEL-9599: camel-cxfrs in simple binding mode should not use content-length 
header from input message in the response.


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

Branch: refs/heads/master
Commit: 77b4593ee77d1e8081b2f488f47ddfc11201f7d1
Parents: 8fd0711
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sat Feb 13 17:53:10 2016 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sat Feb 13 17:54:33 2016 +0100

----------------------------------------------------------------------
 .../apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/77b4593e/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java
----------------------------------------------------------------------
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java
index 9aa8e11..9bccb1f 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/SimpleCxfRsBinding.java
@@ -191,9 +191,6 @@ public class SimpleCxfRsBinding extends DefaultCxfRsBinding 
{
      * <p />
      * The {@link DefaultCxfRsBinding} doesn't filter the response headers 
according to the {@link HeaderFilterStrategy}, 
      * so we handle this task in this binding.
-     * @param headers
-     * @param camelExchange
-     * @return
      */
     protected Map<String, String> 
filterCamelHeadersForResponseHeaders(Map<String, Object> headers,
                                                                      
org.apache.camel.Exchange camelExchange) {
@@ -202,6 +199,11 @@ public class SimpleCxfRsBinding extends 
DefaultCxfRsBinding {
             if 
(getHeaderFilterStrategy().applyFilterToCamelHeaders(entry.getKey(), 
entry.getValue(), camelExchange)) {
                 continue;
             }
+            // skip content-length as the simple binding with Response will 
set correct content-length based
+            // on the entity set as the Response
+            if ("content-length".equalsIgnoreCase(entry.getKey())) {
+                continue;
+            }
             answer.put(entry.getKey(), entry.getValue().toString());
         }
         return answer;

Reply via email to