From fca12415e7434878fd7d9897bafbf683633aa802 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: Tue, 31 May 2022 10:53:02 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20GlobalCacheReques?= =?UTF-8?q?tFilter=20=E4=BD=BF=E7=94=A8=E6=9E=9A=E4=B8=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/gateway/filter/GlobalCacheRequestFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/GlobalCacheRequestFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/GlobalCacheRequestFilter.java index 60f5af7c..50b059be 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/GlobalCacheRequestFilter.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/GlobalCacheRequestFilter.java @@ -21,7 +21,7 @@ public class GlobalCacheRequestFilter implements GlobalFilter, Ordered { public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { // GET DELETE 不过滤 HttpMethod method = exchange.getRequest().getMethod(); - if (method == null || method.matches("GET") || method.matches("DELETE")) { + if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE) { return chain.filter(exchange); } return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> {