Skip to content

Commit

Permalink
Fix the bug that Chinese characters are malformed in response body of…
Browse files Browse the repository at this point in the history
… ZuulBlockFallbackProvider (alibaba#737)
  • Loading branch information
yinjihuan authored and sczyh30 committed May 9, 2019
1 parent 6e45608 commit 274ecb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ public Object run() throws ZuulException {
// Set fallback response.
ctx.setResponseBody(blockResponse.toString());
ctx.setResponseStatusCode(blockResponse.getCode());
// Set Response ContentType
ctx.getResponse().setContentType("application/json; charset=utf-8");
} finally {
// We don't exit the entry here. We need to exit the entries in post filter to record Rt correctly.
// So here the entries will be carried in the request context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ public ZuulFilter sentinelZuulPostFilter() {
public ZuulFilter sentinelZuulErrorFilter() {
return new SentinelZuulErrorFilter(-1);
}
}
}

0 comments on commit 274ecb5

Please sign in to comment.