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

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

commit d062cfb517cf08bbdd924afb22784c4e0ff26bc3
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Feb 25 19:43:43 2021 +0100

    camel-http - optimize a bit
---
 .../apache/camel/component/http/helper/HttpMethodHelper.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpMethodHelper.java
 
b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpMethodHelper.java
index 64a8053..474048d 100644
--- 
a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpMethodHelper.java
+++ 
b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpMethodHelper.java
@@ -40,13 +40,13 @@ public final class HttpMethodHelper {
         String queryString = exchange.getIn().getHeader(Exchange.HTTP_QUERY, 
String.class);
         // We need also check the HTTP_URI header query part
         String uriString = exchange.getIn().getHeader(Exchange.HTTP_URI, 
String.class);
-        // resolve placeholders in uriString
-        try {
-            uriString = 
exchange.getContext().resolvePropertyPlaceholders(uriString);
-        } catch (Exception e) {
-            throw new RuntimeExchangeException("Cannot resolve property 
placeholders with uri: " + uriString, exchange, e);
-        }
         if (uriString != null) {
+            // resolve placeholders in uriString
+            try {
+                uriString = 
exchange.getContext().resolvePropertyPlaceholders(uriString);
+            } catch (Exception e) {
+                throw new RuntimeExchangeException("Cannot resolve property 
placeholders with uri: " + uriString, exchange, e);
+            }
             // in case the URI string contains unsafe characters
             uriString = UnsafeUriCharactersEncoder.encodeHttpURI(uriString);
             URI uri = new URI(uriString);

Reply via email to