You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by ke...@apache.org on 2021/07/14 08:59:35 UTC
[incubator-shenyu] branch master updated: [ISSUE #1770] Solve the
problem of duplicate URL-encoding (#1771)
This is an automated email from the ASF dual-hosted git repository.
kevinclair pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 4a5e1a0 [ISSUE #1770] Solve the problem of duplicate URL-encoding (#1771)
4a5e1a0 is described below
commit 4a5e1a0aae4a40db3a7b949d164b25141331a348
Author: Jian Liu <98...@qq.com>
AuthorDate: Wed Jul 14 03:59:26 2021 -0500
[ISSUE #1770] Solve the problem of duplicate URL-encoding (#1771)
* fix the #1770 issue
* fix the #1770 issue
* fix the #1770 issue (use URI.create method)
* fix the #1770 issue (use URI.create method)
Co-authored-by: liujian <li...@xiaomi.com>
---
.../java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java b/shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java
index 546bb58..61e20c2 100644
--- a/shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java
+++ b/shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/WebClientPlugin.java
@@ -39,6 +39,8 @@ import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import reactor.retry.Backoff;
import reactor.retry.Retry;
+
+import java.net.URI;
import java.time.Duration;
import java.util.Objects;
import java.util.Optional;
@@ -73,7 +75,7 @@ public class WebClientPlugin implements ShenyuPlugin {
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);
+ WebClient.RequestBodySpec requestBodySpec = webClient.method(method).uri(URI.create(urlPath));
return handleRequestBody(requestBodySpec, exchange, timeout, retryTimes, chain);
}