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

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


The following commit(s) were added to refs/heads/main by this push:
     new 23b770fe644 [CAMEL-18530] Camel box cannot authorize
23b770fe644 is described below

commit 23b770fe644dbb0a190cfd9d608f96027b7017d6
Author: Croway <federico.mariani.1...@gmail.com>
AuthorDate: Tue Sep 20 13:53:46 2022 +0200

    [CAMEL-18530] Camel box cannot authorize
---
 .../component/box/internal/BoxConnectionHelper.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java
 
b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java
index be976b1c40b..b7ad7ee3b5e 100644
--- 
a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java
+++ 
b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/internal/BoxConnectionHelper.java
@@ -139,16 +139,16 @@ public final class BoxConnectionHelper {
             //parse request_token from javascript from head, it is the first 
script in the header
             final String requestTokenScript = 
consentPage.select("script").first().html();
             final Matcher m = 
Pattern.compile("var\\s+request_token\\s+=\\s+'([^'].+)'.*").matcher(requestTokenScript);
+            String requestToken = "";
             if (m.find()) {
-                final String requestToken = m.group(1);
-                response = addProxy(consentForm.submit(), proxy)
-                        .data("request_token", requestToken)
-                        .followRedirects(false)
-                        .cookies(cookies)
-                        .execute();
-            } else {
-                throw new IllegalArgumentException("Error authorizing 
application: Can not parse request token.");
+                requestToken = m.group(1);
             }
+            response = addProxy(consentForm.submit(), proxy)
+                    .data("request_token", requestToken)
+                    .followRedirects(false)
+                    .cookies(cookies)
+                    .execute();
+
             final String location = response.header("Location");
 
             final Map<String, String> params = new HashMap<>();

Reply via email to