From 23c48f76246dfdae8a4a55e9164e7c16792c75da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sun, 2 Apr 2023 21:35:04 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20WebFluxUtils.getO?= =?UTF-8?q?riginalRequestUrl=20=E6=96=B9=E6=B3=95=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=A9=BA=E8=B7=AF=E5=BE=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/gateway/utils/WebFluxUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/utils/WebFluxUtils.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/utils/WebFluxUtils.java index 38a32523..9672e7e5 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/utils/WebFluxUtils.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/utils/WebFluxUtils.java @@ -39,7 +39,7 @@ public class WebFluxUtils { */ public static String getOriginalRequestUrl(ServerWebExchange exchange) { ServerHttpRequest request = exchange.getRequest(); - LinkedHashSet uris = exchange.getRequiredAttribute(GATEWAY_ORIGINAL_REQUEST_URL_ATTR); + LinkedHashSet uris = exchange.getAttributeOrDefault(GATEWAY_ORIGINAL_REQUEST_URL_ATTR, new LinkedHashSet<>()); URI requestUri = uris.stream().findFirst().orElse(request.getURI()); return UriComponentsBuilder.fromPath(requestUri.getRawPath()).build().toUriString(); }