Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x cd7e6fc3c -> bdbfc1783
  refs/heads/camel-2.16.x d59cac1d4 -> 0d2648cfa


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/0d2648cf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0d2648cf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0d2648cf

Branch: refs/heads/camel-2.16.x
Commit: 0d2648cfad546a654608af93186c0b72f5ba4d46
Parents: d59cac1
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:53:46 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/0d2648cf/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