diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java index d3e891a5..87df32b9 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java @@ -14,8 +14,11 @@ import com.gitee.sop.gatewaycommon.result.ResultExecutorForGateway; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.util.UriUtils; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; @@ -46,6 +49,9 @@ public class GatewayResultExecutor extends BaseExecutorAdapter at ").append(stackTraceElement.toString()); } - response.setHeader("x-service-error-message", msg.toString()); + response.setHeader("x-service-error-message", UriUtils.encode(msg.toString(), StandardCharsets.UTF_8)); return this.processError(request, response, new ServiceException("系统繁忙")); }