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 2021/02/22 08:24:09 UTC

[camel] branch exchange-factory updated: CAMEL-16233: Fix camel-http - Optimize to avoid type convertion that would do deep checking.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch exchange-factory
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/exchange-factory by this push:
     new aad2539  CAMEL-16233: Fix camel-http - Optimize to avoid type convertion that would do deep checking.
aad2539 is described below

commit aad253955b61b3fd5c74298c43a282fdd9e41dd5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 18 15:13:58 2021 +0100

    CAMEL-16233: Fix camel-http - Optimize to avoid type convertion that would do deep checking.
---
 .../src/main/java/org/apache/camel/component/http/HttpProducer.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
index b79e354..b789c40 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
@@ -616,6 +616,8 @@ public class HttpProducer extends DefaultProducer {
         try {
             if (body == null) {
                 return null;
+            } else if (body instanceof HttpEntity) {
+                answer = (HttpEntity) body;
                 // special optimized for using these 3 type converters for common message payload types
             } else if (body instanceof byte[]) {
                 answer = HttpEntityConverter.toHttpEntity((byte[]) body, exchange);