key9527 commented on code in PR #4266:
URL: https://github.com/apache/shenyu/pull/4266#discussion_r1057479250
##########
shenyu-plugin/shenyu-plugin-api/src/main/java/org/apache/shenyu/plugin/api/result/ShenyuResult.java:
##########
@@ -70,7 +70,7 @@ default MediaType contentType(ServerWebExchange exchange,
Object formatted) {
if (Objects.nonNull(clientResponse) &&
clientResponse.headers().contentType().isPresent()) {
return clientResponse.headers().contentType().get();
}
- return MediaType.APPLICATION_JSON;
+ return MediaType.APPLICATION_JSON_UTF8;
Review Comment:
this code is used for WebFluxResultUtils.result(exchange, error); for
example:
`
if (CollectionUtils.isEmpty(upstreamList)) {
LOG.error("divide upstream configuration error: {}", selector);
Object error = ShenyuResultWrap.error(exchange,
ShenyuResultEnum.CANNOT_FIND_HEALTHY_UPSTREAM_URL);
return WebFluxResultUtils.result(exchange, error);
}
`
If I customize the error message in chinese,when this msg returned , The
receiver cannot recognize this charset。because this is shenyu returned, not
back-end service。
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]