diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java index 416d92a3..596e7984 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java @@ -15,7 +15,10 @@ import com.netflix.util.Pair; import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.exception.ZuulException; import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; +import org.springframework.web.util.UriUtils; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; import java.util.function.Consumer; @@ -39,11 +42,15 @@ public class ZuulResultExecutor extends BaseExecutorAdapter{ + String errorMsg = getHeader(requestContext, SopConstants.X_SERVICE_ERROR_MESSAGE, (index)->{ if (index > -1) { requestContext.getZuulResponseHeaders().remove(index); } }); + if (StringUtils.hasText(errorMsg)) { + errorMsg = UriUtils.decode(errorMsg, StandardCharsets.UTF_8); + } + return errorMsg; } @Override