camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] camel git commit: CAMEL-9794: camel-http4 - The producer should check the response header in the reply for content-type
Date Fri, 01 Apr 2016 17:27:44 GMT
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/8720947b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8720947b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8720947b

Branch: refs/heads/camel-2.17.x
Commit: 8720947b98cd0bfd542d725d180a99d95e15244e
Parents: a1ec88c
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Apr 1 19:26:40 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Apr 1 19:27:18 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/8720947b/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 9d259ec..7622d02 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


Mime
View raw message