mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-23 02:48:34 +08:00
update 优化 WebFluxUtils.getOriginalRequestUrl 方法获取空路径报错问题
This commit is contained in:
@@ -39,7 +39,7 @@ public class WebFluxUtils {
|
|||||||
*/
|
*/
|
||||||
public static String getOriginalRequestUrl(ServerWebExchange exchange) {
|
public static String getOriginalRequestUrl(ServerWebExchange exchange) {
|
||||||
ServerHttpRequest request = exchange.getRequest();
|
ServerHttpRequest request = exchange.getRequest();
|
||||||
LinkedHashSet<URI> uris = exchange.getRequiredAttribute(GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
|
LinkedHashSet<URI> uris = exchange.getAttributeOrDefault(GATEWAY_ORIGINAL_REQUEST_URL_ATTR, new LinkedHashSet<>());
|
||||||
URI requestUri = uris.stream().findFirst().orElse(request.getURI());
|
URI requestUri = uris.stream().findFirst().orElse(request.getURI());
|
||||||
return UriComponentsBuilder.fromPath(requestUri.getRawPath()).build().toUriString();
|
return UriComponentsBuilder.fromPath(requestUri.getRawPath()).build().toUriString();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user