yes, I viewed the commit.  and I try like this:

final MultiValueMap<String, String&gt; queryParams = 
exchange.getRequest().getQueryParams();
if (queryParams.isEmpty()) {
    return path;
}
StringJoiner paramBuilder = new StringJoiner("&amp;");
for (final Map.Entry<String, List<String&gt;&gt; param : 
queryParams.entrySet()) {
    for (final String value : param.getValue()) {
        paramBuilder.add(String.format("%s=%s", param.getKey(), value));
    }
}&nbsp;but the "request.getQueryParam" is decoded.
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"yudong tang"<[email protected]&gt;;
Date: &nbsp;Sat, Oct 9, 2021 02:27 PM
To: &nbsp;"dev"<[email protected]&gt;; 

Subject: &nbsp;Re: #2200, #2203 discussion(picture in pr#2203)

&nbsp;

I found we have changed it to getRawQuery and we changed it back again in
May.

zcq <[email protected]&gt; 于2021年10月9日周六 上午11:20写道:

&gt; Hi,
&gt; When arguments contain special characters, the original "DividePlugin"
&gt; implementation uses "getQuery" which decode the arguments("decodeQuery" in
&gt; picture), to escape those special characters.
&gt;
&gt; eg: GET 
http://localhost:9195/http/test/divide/raw?name=divide&amp;address=%23
&gt;
&gt; see "getquery.png"
&gt;
&gt; The result: see "getquery-ret.png"
&gt;
&gt; But the "getRawQuery" will use the origin arguments("query" in picture).
&gt;
&gt; the result: see "getrawquery-ret.png"
&gt;
&gt;
&gt; So if the arguments contain special characters, "getRawQuery" is better
&gt; choice.
&gt;
&gt; The other way, user can encode arguments by self.
&gt;
&gt;&nbsp; https://github.com/apache/incubator-shenyu/pull/2203 page.
&gt;
&gt;

-- 
Yudong Tang
Apache Shenyu(Incubator)

Reply via email to