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

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


The following commit(s) were added to refs/heads/camel-3.14.x by this push:
     new 4108b48169c CAMEL-18250: don't set the http headers when timeout 
(#7953)
4108b48169c is described below

commit 4108b48169c84f65d9922f23c3aeac9da3c708f0
Author: Babak Vahdat <bvah...@apache.org>
AuthorDate: Fri Jul 1 11:00:12 2022 +0200

    CAMEL-18250: don't set the http headers when timeout (#7953)
---
 .../component/salesforce/internal/client/AbstractClientBase.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
index 66f0610509e..931f24ccf5f 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
@@ -305,8 +305,12 @@ public abstract class AbstractClientBase extends 
ServiceSupport
                 answer.put(headerName, header.getValue());
             }
         }
-        answer.put(Exchange.HTTP_RESPONSE_CODE, 
String.valueOf(response.getStatus()));
-        answer.put(Exchange.HTTP_RESPONSE_TEXT, response.getReason());
+
+        // don't set the response code to "0" and the response text to null if 
there's a response timeout
+        if (response.getStatus() != 0) {
+            answer.put(Exchange.HTTP_RESPONSE_CODE, 
String.valueOf(response.getStatus()));
+            answer.put(Exchange.HTTP_RESPONSE_TEXT, response.getReason());
+        }
 
         return answer;
     }

Reply via email to