You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/10/23 12:09:47 UTC

[camel-k-runtime] 01/03: kamelet: use raw url

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

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit ad66520a48959463820cd410ccd1dfb6a2744cfd
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Fri Oct 23 12:13:48 2020 +0200

    kamelet: use raw url
---
 .../org/apache/camel/component/kamelet/KameletComponent.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
index f072686..6908f30 100644
--- a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
+++ b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletComponent.java
@@ -35,6 +35,7 @@ import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 import org.apache.camel.support.LifecycleStrategySupport;
 import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -124,7 +125,7 @@ public class KameletComponent extends DefaultComponent {
 
             // determine the parameters that the kamelet should take by using the original
             // uri as we need to preserve the original format.
-            final String query = URISupport.extractQuery(uri);
+            final String query = StringHelper.after(uri, "?");
             final Map<String, Object> queryParams = URISupport.parseQuery(query, true, true);
 
             // replace resolved params with the original ones
@@ -175,6 +176,12 @@ public class KameletComponent extends DefaultComponent {
     }
 
     @Override
+    public boolean useRawUri() {
+        // should use encoded uri by default
+        return true;
+    }
+
+    @Override
     protected void doInit() throws Exception {
         getCamelContext().addLifecycleStrategy(lifecycleHandler);