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:43 UTC

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

Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 25fba6c3c -> feead099b
  refs/heads/camel-2.17.x a1ec88c95 -> 8720947b9
  refs/heads/master 61e192d09 -> ae2c751e5


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

Branch: refs/heads/master
Commit: ae2c751e545f3c6f4b757009818d0ca1eca315c3
Parents: 61e192d
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:26:40 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/ae2c751e/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


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

Posted by da...@apache.org.
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


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

Posted by da...@apache.org.
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 <da...@apache.org>
Authored: Fri Apr 1 19:26:40 2016 +0200
Committer: Claus Ibsen <da...@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