You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2021/07/14 07:10:52 UTC

[GitHub] [incubator-shenyu] SouthEastLJ commented on a change in pull request #1771: [ISSUE #1770] Solve the problem of duplicate URL-encoding

SouthEastLJ commented on a change in pull request #1771:
URL: https://github.com/apache/incubator-shenyu/pull/1771#discussion_r669349957



##########
File path: shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java
##########
@@ -73,7 +76,13 @@ public WebClientPlugin(final WebClient webClient) {
         int retryTimes = (int) Optional.ofNullable(exchange.getAttribute(Constants.HTTP_RETRY)).orElse(0);
         log.info("The request urlPath is {}, retryTimes is {}", urlPath, retryTimes);
         HttpMethod method = HttpMethod.valueOf(exchange.getRequest().getMethodValue());
-        WebClient.RequestBodySpec requestBodySpec = webClient.method(method).uri(urlPath);
+        try {
+            uriObject = new URI(urlPath);
+        } catch (Exception e) {
+            log.error("build URI object error",e);
+            return WebFluxResultUtils.result(exchange, e);
+        }
+        WebClient.RequestBodySpec requestBodySpec = webClient.method(method).uri(uriObject);

Review comment:
       Has been modified according to your suggestion




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org