You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "MajaChen (via GitHub)" <gi...@apache.org> on 2024/01/06 03:34:58 UTC
[PR] Hotfix rest Chinese encoding [dubbo]
MajaChen opened a new pull request, #13617:
URL: https://github.com/apache/dubbo/pull/13617
## What is the purpose of the change
When utilizing Dubbo REST with the @QueryParam annotation on parameters, issues with Chinese character decoding may arise. Refer to the [13349 issue](https://github.com/apache/dubbo/issues/13349) for a comprehensive and detailed description of the problem, including its cause, solution, and an explanation of why it works.
## Brief changelog
RequestFacade.initParameters will decode the request uri with UTF-8 before parsing uri to parameters.
## Verifying this change
- I add more unit tests , then can pass, and I recommend you refer the [13349 issue](https://github.com/apache/dubbo/issues/13349)
<!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
- [ ] GitHub Actions works fine on your own branch.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1446913503
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -56,6 +58,17 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = requestURI;
+ try {
+ decodedRequestURI = URLDecoder.decode(decodedRequestURI, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // do nothing
+ }
Review Comment:
This is hardcoded, we can set utf-8 by default, but it must come from `Accept-Charset` first.
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1889505458
Take an example of SpringMVC framework, Chinese character encoding problems are very common among Chinese developers, and it offers solution. I think dubbo should also offer such solution to avoid such problems, even though it's not common to pass Chinese character as parameter. But in my situation,I does need to do so.
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM merged PR #13617:
URL: https://github.com/apache/dubbo/pull/13617
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1888937432
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[81.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "kimmking (via GitHub)" <gi...@apache.org>.
kimmking commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1889728708
I know your case now.
BTW: It need/maybe process q param to parse Accept-Charset field like:
```
Accept-Charset: <charset>
// Multiple types, weighted with the [quality value](https://developer.mozilla.org/zh-CN/docs/Glossary/Quality_values) syntax:
Accept-Charset: utf-8, iso-8859-1;q=0.5
```
refer:
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Accept-Charset
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1879563013
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[75.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1457522459
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -55,6 +58,24 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = null;
+
+ try {
+ String enc = "UTF-8";
Review Comment:
fine
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1448331987
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -56,6 +58,17 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = requestURI;
+ try {
+ decodedRequestURI = URLDecoder.decode(decodedRequestURI, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // do nothing
+ }
Review Comment:
I've made an adjustment according to your opinon, please take a look again, take your time@
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1879536028
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/13617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`e583187`)](https://app.codecov.io/gh/apache/dubbo/commit/e583187aac96760860af5d67c965d3391ff2ff4d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 70.38% compared to head [(`ea6c6fc`)](https://app.codecov.io/gh/apache/dubbo/pull/13617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 70.37%.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.2 #13617 +/- ##
==========================================
- Coverage 70.38% 70.37% -0.02%
==========================================
Files 1606 1606
Lines 69999 70007 +8
Branches 10098 10100 +2
==========================================
- Hits 49272 49266 -6
- Misses 16103 16113 +10
- Partials 4624 4628 +4
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/13617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1890329189
I add a new method parseAcceptCharset, it can deal with multi values related with Accept-Charset.
It worked well as demonstrated by unit test.
I think it's ok to take the charset with the biggest weight alone.
I'm doubtful whether these code have pratical function in most case. As Accept-Charset is not recommended to use.
Most importantly, OkhttpClient don't take Accept-Charset into consideration when encoding url,see:
builder.url(requestTemplate.getURL()); (OKHttpRestClient.java line 55)
But I still think adding Accept-Charset make code more rigorous and compatible
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1890817165
PATL, thanks
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1446916056
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -56,6 +58,17 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = requestURI;
+ try {
+ decodedRequestURI = URLDecoder.decode(decodedRequestURI, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // do nothing
+ }
Review Comment:
ok, I'll make a adjustment
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1886315975
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[81.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1889525261
And many users including me, are not familiar with json standard format(sorry for that).So this bug can be a trap
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1880063998
@suncairong163 PTAL
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1890335136
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[3 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[90.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1890366308
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[93.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1457394409
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -55,6 +58,24 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = null;
+
+ try {
+ String enc = "UTF-8";
Review Comment:
It should also be placed in `Constant`.
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1898658851
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[93.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on code in PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#discussion_r1448331987
##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java:
##########
@@ -56,6 +58,17 @@ protected void initHeaders() {}
protected void initParameters() {
String requestURI = getRequestURI();
+ String decodedRequestURI = requestURI;
+ try {
+ decodedRequestURI = URLDecoder.decode(decodedRequestURI, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // do nothing
+ }
Review Comment:
I've made an adjustment according to your opinon, please take a look again, take your time
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "MajaChen (via GitHub)" <gi...@apache.org>.
MajaChen commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1884210815
I'm wondering if anybody can review my code
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "kimmking (via GitHub)" <gi...@apache.org>.
kimmking commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1889440812
As json standard format, non-ansi chars are not allowed, so is nessary to do this?
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Hotfix rest Chinese encoding [dubbo]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13617:
URL: https://github.com/apache/dubbo/pull/13617#issuecomment-1879532180
## [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617) **Quality Gate passed**
The SonarCloud Quality Gate passed, but some issues were introduced.
[2 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=13617&resolved=false&inNewCodePeriod=true)
[75.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=13617&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=13617)
--
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@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org