-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL encoding is performed when passing URL parameters under the rest protocol #13349
Comments
@suncairong163 PTAL |
demo-bug.zip |
@wiscloud 这个代码我试过了,问题还是这个,至于放到一个模块的情况,dubbo直接走了injvmInvoker,相当于本地调用了 |
我也遇到了同样的问题,这个issue我先认领了,我尝试解决一下 |
@MajaChen |
@CrazyHZM 我正在努力修复,麻烦再给我两周时间,看到2024年1月7号能否解决,或者考虑放弃。谢谢! |
In English, I've read the code very carefully, I think I've come up a proper way to fix the problem, see the pull request, it also contains necessary unit test. cause:
solution:We need to decode the parameters with UTF-8 in RequestFascade.initParameters. For simplicity, I decode the whole uri and I'm pretty sure is safe even the uri is not encoded with UTF-8 at all in consumer side. You can refer the unit test in NettyRequestFacadeTest. demonstration: |
supplement: if you use @QueryParam to annotate the parameter,the parameter will be trated as request parameter in RequestTemplate, and it can cause problmes; But if you don't, the parameter will be trated as request body, the problem won't occur. |
@CrazyHZM I've launch a pull request, can you review the code |
When requesting, the sayHello method uses URL parameters and performs URL encoding, and the server directly returns a String that is also URL encoded. The second method say does not have such a problem.
请求时,sayHello方法采用了 URL 传参,进行了 URL 编码,且服务端直接返回 String 也进行了 URL 编码,第二个方法say并没有这样的问题。
The text was updated successfully, but these errors were encountered: