Skip to content

Fix the bug that Chinese characters are garbled in ResponseBody of ZuulBlockFallbackProvider #737

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

Merged
merged 4 commits into from
May 9, 2019

Conversation

yinjihuan
Copy link
Contributor

@yinjihuan yinjihuan commented May 7, 2019

Describe what this PR does / why we need it

Fix the bug that Chinese characters are garbled in ResponseBody of ZuulBlockFallbackProvider.

Does this pull request fix one issue?

Fixes #733

Describe how you did it

Add a line ctx.getResponse().setContentType("application/json; charset=utf-8");

Describe how to verify it

Custom ZuulBlockFallbackProvider, Set the message field to Chinese,Trigger current limiting,Message field Chinese display is normal

Special notes for reviews

NO

@CLAassistant
Copy link

CLAassistant commented May 7, 2019

CLA assistant check
All committers have signed the CLA.

@sczyh30 sczyh30 changed the title Chinese garbled Fix the bug that Chinese characters are garbled in ResponseBody of ZuulBlockFallbackProvider May 7, 2019
@sczyh30 sczyh30 added the to-review To review label May 7, 2019
@codecov-io
Copy link

Codecov Report

Merging #737 into master will increase coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #737      +/-   ##
============================================
+ Coverage     40.96%   41.02%   +0.06%     
- Complexity     1335     1337       +2     
============================================
  Files           301      301              
  Lines          8630     8631       +1     
  Branches       1159     1159              
============================================
+ Hits           3535     3541       +6     
+ Misses         4668     4664       -4     
+ Partials        427      426       -1
Impacted Files Coverage Δ Complexity Δ
...er/gateway/zuul/filters/SentinelZuulPreFilter.java 14.58% <0%> (-0.32%) 3 <0> (ø)
...tinel/slots/block/flow/param/ParamFlowChecker.java 55.4% <0%> (+2.7%) 29% <0%> (+1%) ⬆️
...m/alibaba/csp/sentinel/log/DateFileLogHandler.java 57.57% <0%> (+3.03%) 7% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e45608...9f112a0. Read the comment docs.

Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sczyh30 sczyh30 merged commit 274ecb5 into alibaba:master May 9, 2019
@sczyh30
Copy link
Member

sczyh30 commented May 9, 2019

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chinese characters are malformed in response body of ZuulBlockFallbackProvider
4 participants