yes, I viewed the commit. and I try like this:
final MultiValueMap<String, String> queryParams =
exchange.getRequest().getQueryParams();
if (queryParams.isEmpty()) {
return path;
}
StringJoiner paramBuilder = new StringJoiner("&");
for (final Map.Entry<String, List<String>> param :
queryParams.entrySet()) {
for (final String value : param.getValue()) {
paramBuilder.add(String.format("%s=%s", param.getKey(), value));
}
} but the "request.getQueryParam" is decoded.
------------------ Original ------------------
From: "yudong tang"<[email protected]>;
Date: Sat, Oct 9, 2021 02:27 PM
To: "dev"<[email protected]>;
Subject: Re: #2200, #2203 discussion(picture in pr#2203)
I found we have changed it to getRawQuery and we changed it back again in
May.
zcq <[email protected]> 于2021年10月9日周六 上午11:20写道:
> Hi,
> When arguments contain special characters, the original "DividePlugin"
> implementation uses "getQuery" which decode the arguments("decodeQuery" in
> picture), to escape those special characters.
>
> eg: GET
http://localhost:9195/http/test/divide/raw?name=divide&address=%23
>
> see "getquery.png"
>
> The result: see "getquery-ret.png"
>
> But the "getRawQuery" will use the origin arguments("query" in picture).
>
> the result: see "getrawquery-ret.png"
>
>
> So if the arguments contain special characters, "getRawQuery" is better
> choice.
>
> The other way, user can encode arguments by self.
>
> https://github.com/apache/incubator-shenyu/pull/2203 page.
>
>
--
Yudong Tang
Apache Shenyu(Incubator)