You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/01 19:27:45 UTC

[3/3] camel git commit: CAMEL-9794: camel-http4 - The producer should check the response header in the reply for content-type

CAMEL-9794: camel-http4 - The producer should check the response header in the reply for content-type


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

Branch: refs/heads/camel-2.16.x
Commit: feead099b83b8a2ce530272d7b93ebb0fc1eadb8
Parents: 25fba6c
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Apr 1 19:26:40 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Apr 1 19:27:35 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/http4/HttpProducer.java    | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/feead099/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
index 09f347d..eb2fb91 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
@@ -299,10 +299,6 @@ public class HttpProducer extends DefaultProducer {
 
     /**
      * Extracts the response from the method as a InputStream.
-     *
-     * @param httpRequest the method that was executed
-     * @return the response either as a stream, or as a deserialized java object
-     * @throws IOException can be thrown
      */
     protected Object extractResponseBody(HttpRequestBase httpRequest, HttpResponse httpResponse, Exchange exchange, boolean ignoreResponseBody) throws IOException, ClassNotFoundException {
         HttpEntity entity = httpResponse.getEntity();
@@ -323,7 +319,7 @@ public class HttpProducer extends DefaultProducer {
         }
         // Honor the character encoding
         String contentType = null;
-        header = httpRequest.getFirstHeader("content-type");
+        header = httpResponse.getFirstHeader("content-type");
         if (header != null) {
             contentType = header.getValue();
             // find the charset and set it to the Exchange