mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-26 05:38:20 +00:00
update 优化 GlobalCacheRequestFilter 使用枚举替换字符串
This commit is contained in:
@@ -21,7 +21,7 @@ public class GlobalCacheRequestFilter implements GlobalFilter, Ordered {
|
|||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||||
// GET DELETE 不过滤
|
// GET DELETE 不过滤
|
||||||
HttpMethod method = exchange.getRequest().getMethod();
|
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 chain.filter(exchange);
|
||||||
}
|
}
|
||||||
return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> {
|
return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> {
|
||||||
|
Reference in New Issue
Block a user