mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-09-02 10:48:41 +00:00
此处修改曾导致 nacos修改xss开关时,spring容器未重启,filter仍起效。故增加参数判断,参数刷新后,xss开关正常关闭。
此处修改曾导致 nacos修改xss开关时,spring容器未重启,filter仍起效。故增加参数判断,参数刷新后,xss开关正常关闭。 Signed-off-by: ylwang <ylwang@makwing.com>
This commit is contained in:
@@ -42,6 +42,10 @@ public class XssFilter implements GlobalFilter, Ordered
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain)
|
||||
{
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
// xss开关未开启 或 通过nacos关闭,不过滤
|
||||
if(!xss.getEnabled()){
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
// GET DELETE 不过滤
|
||||
HttpMethod method = request.getMethod();
|
||||
if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE)
|
||||
|
Reference in New Issue
Block a user