camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] branch camel-2.21.x updated: fix CAMEL-12787 Accept header is not respected anymore in CXFRS consumer when POST
Date Mon, 10 Sep 2018 06:31:06 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
     new db7c933  fix CAMEL-12787 Accept header is not respected anymore in CXFRS consumer
when POST
db7c933 is described below

commit db7c9337d2914d504eff21757cab966d3dd75303
Author: Xilai Dai <xldai@talend.com>
AuthorDate: Sun Sep 9 12:36:44 2018 +0800

    fix CAMEL-12787 Accept header is not respected anymore in CXFRS consumer when POST
---
 .../java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
index 1ae15e9..8679bba 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
@@ -115,7 +115,7 @@ public class DefaultCxfRsBinding implements CxfRsBinding, HeaderFilterStrategyAw
             if (response.getHeader(Exchange.HTTP_RESPONSE_CODE) != null && !cxfExchange.containsKey(org.apache.cxf.message.Message.RESPONSE_CODE))
{
                 cxfExchange.put(org.apache.cxf.message.Message.RESPONSE_CODE, response.getHeader(Exchange.HTTP_RESPONSE_CODE,
Integer.class));
             }
-            if (response.getHeader(Exchange.CONTENT_TYPE) != null) {
+            if (response.getHeader(Exchange.CONTENT_TYPE) != null && !cxfExchange.containsKey(org.apache.cxf.message.Message.CONTENT_TYPE))
{
                 if (!ObjectHelper.isEmpty(cxfExchange) && !ObjectHelper.isEmpty(cxfExchange.getOutMessage()))
{
                     cxfExchange.getOutMessage().putIfAbsent(org.apache.cxf.message.Message.PROTOCOL_HEADERS,

                                                         new TreeMap<>(String.CASE_INSENSITIVE_ORDER));


Mime
View raw message