camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject git commit: CAMEL-7363 Preserver the in message to out message in camel-ahc producer with thanks to Stephan
Date Tue, 15 Apr 2014 14:31:43 GMT
Repository: camel
Updated Branches:
  refs/heads/master d152c8515 -> 515259671


CAMEL-7363 Preserver the in message to out message in camel-ahc producer with thanks to Stephan


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

Branch: refs/heads/master
Commit: 515259671ceb9f875f5e121a52ba2c51a54ecfdc
Parents: d152c85
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Tue Apr 15 22:21:41 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Tue Apr 15 22:25:02 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/ahc/DefaultAhcBinding.java     | 1 +
 .../org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java   | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/51525967/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/DefaultAhcBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/DefaultAhcBinding.java
b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/DefaultAhcBinding.java
index fa0af12..dbd8a96 100644
--- a/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/DefaultAhcBinding.java
+++ b/components/camel-ahc/src/main/java/org/apache/camel/component/ahc/DefaultAhcBinding.java
@@ -185,6 +185,7 @@ public class DefaultAhcBinding implements AhcBinding {
 
     @Override
     public void onStatusReceived(AhcEndpoint endpoint, Exchange exchange, HttpResponseStatus
responseStatus) throws Exception {
+        exchange.getOut().setHeaders(exchange.getIn().getHeaders());
         exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, responseStatus.getStatusCode());
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/51525967/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java
b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java
index 549961f..d445aa7 100644
--- a/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java
+++ b/components/camel-ahc/src/test/java/org/apache/camel/component/ahc/AhcProduceGetHeadersTest.java
@@ -52,6 +52,8 @@ public class AhcProduceGetHeadersTest extends BaseAhcTest {
                     .to("mock:result");
 
                 from(getTestServerEndpointUri())
+                        // Remove the message header here
+                        .removeHeaders("*")
                         .transform(constant("Bye World"));
             }
         };


Mime
View raw message