Repository: camel Updated Branches: refs/heads/master a19962b10 -> fd57cfcab
CAMEL-10039: Fixed callback url parsing in LinkedIn and Box Components Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fd57cfca Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fd57cfca Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fd57cfca Branch: refs/heads/master Commit: fd57cfcabcb93e64d3a51737b470faf32de1404e Parents: a19962b Author: Dhiraj Bokde <dhira...@yahoo.com> Authored: Thu Jun 9 23:20:28 2016 -0700 Committer: Dhiraj Bokde <dhira...@yahoo.com> Committed: Thu Jun 9 23:20:59 2016 -0700 ---------------------------------------------------------------------- .../org/apache/camel/component/box/internal/LoginAuthFlowUI.java | 4 ++-- .../camel/component/linkedin/api/LinkedInOAuthRequestFilter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/fd57cfca/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java ---------------------------------------------------------------------- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java index 8044ecd..778db59 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java @@ -17,13 +17,13 @@ package org.apache.camel.component.box.internal; import java.io.IOException; +import java.net.URL; import java.security.GeneralSecurityException; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.net.ssl.SSLContext; import com.box.boxjavalibv2.BoxClient; @@ -165,7 +165,7 @@ public final class LoginAuthFlowUI implements IAuthFlowUI { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); - redirectQuery = location.substring(location.indexOf('?') + 1); + redirectQuery = new URL(location).getQuery(); } final Map<String, String> params = new HashMap<String, String>(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery); http://git-wip-us.apache.org/repos/asf/camel/blob/fd57cfca/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java ---------------------------------------------------------------------- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index 4d781d1..e30910a 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -202,7 +202,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); - redirectQuery = location.substring(location.indexOf('?') + 1); + redirectQuery = new URL(location).getQuery(); } final Map<String, String> params = new HashMap<String, String>(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery);