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 2016/01/10 10:54:14 UTC
[2/2] camel git commit: Fixed url rewrite issue after a recent bug
fix.
Fixed url rewrite issue after a recent bug fix.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/92b137d4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/92b137d4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/92b137d4
Branch: refs/heads/camel-2.16.x
Commit: 92b137d4c87da8b0f21d2e4e53623361d6aa0f68
Parents: 1febbd6
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jan 10 10:53:19 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 10 10:53:35 2016 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/camel/http/common/HttpHelper.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/92b137d4/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
index 4a3c952..2365eb6 100644
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
+++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
@@ -412,6 +412,10 @@ public final class HttpHelper {
// we should use the relative path if possible
String baseUrl;
relativeUrl = endpoint.getHttpUri().toASCIIString();
+ // strip query parameters from relative url
+ if (relativeUrl.contains("?")) {
+ relativeUrl = ObjectHelper.before(relativeUrl, "?");
+ }
if (url.startsWith(relativeUrl)) {
baseUrl = url.substring(0, relativeUrl.length());
relativeUrl = url.substring(relativeUrl.length());