CAMEL-8821 merged the patch into camel-http4

Conflicts:
        
components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java


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

Branch: refs/heads/camel-2.15.x
Commit: 9e126430bf239eaeed80222e9c2bfa184de542f3
Parents: 5fd98e3
Author: Willem Jiang <[email protected]>
Authored: Sun May 31 11:10:58 2015 +0800
Committer: Willem Jiang <[email protected]>
Committed: Sun May 31 17:08:14 2015 +0800

----------------------------------------------------------------------
 .../camel/component/http4/DefaultHttpBinding.java       |  2 +-
 .../apache/camel/component/http4/helper/HttpHelper.java | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9e126430/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
----------------------------------------------------------------------
diff --git 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
index 7064c78..26c846b 100644
--- 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
+++ 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
@@ -418,7 +418,7 @@ public class DefaultHttpBinding implements HttpBinding {
                     return null;
                 }
             }
-            // reade the response body from servlet request
+            // read the response body from servlet request
             return HttpHelper.readResponseBodyFromServletRequest(request, 
httpMessage.getExchange());
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/9e126430/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
----------------------------------------------------------------------
diff --git 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
index 5610d6a..951dd0e 100644
--- 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
+++ 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
@@ -39,6 +39,7 @@ import org.apache.camel.component.http4.HttpMessage;
 import org.apache.camel.component.http4.HttpMethods;
 import org.apache.camel.component.http4.HttpServletUrlRewrite;
 import org.apache.camel.converter.stream.CachedOutputStream;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.URISupport;
@@ -145,8 +146,15 @@ public final class HttpHelper {
             return null;
         }
 
+        boolean disableStreamCaching = false;
+        // Just take the consideration of the setting of Camel Context 
StreamCaching
+        if (exchange.getContext() instanceof DefaultCamelContext) {
+            DefaultCamelContext context = (DefaultCamelContext) 
exchange.getContext();
+            disableStreamCaching = !context.isStreamCaching();
+        }
+
         // convert the input stream to StreamCache if the stream cache is not 
disabled
-        if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, 
Boolean.FALSE, Boolean.class)) {
+        if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, 
disableStreamCaching, Boolean.class)) {
             return is;
         } else {
             CachedOutputStream cos = new CachedOutputStream(exchange);
@@ -233,7 +241,7 @@ public final class HttpHelper {
      *
      * @param exchange the exchange
      * @return the created method
-     * @throws URISyntaxException 
+     * @throws URISyntaxException
      */
     public static HttpMethods createMethod(Exchange exchange, HttpEndpoint 
endpoint, boolean hasPayload) throws URISyntaxException {
         // is a query string provided in the endpoint URI or in a header 
(header

Reply via email to