Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 16eb380b6 -> 368cb746a


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/368cb746
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/368cb746
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/368cb746

Branch: refs/heads/camel-2.17.x
Commit: 368cb746a3467c5ea51030ce5affb76f9d079667
Parents: 16eb380
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:22:26 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/368cb746/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/368cb746/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);

Reply via email to