Pre Merge pull request !286 from ylwang/N/A
This commit is contained in:
commit
d6507e0d3e
|
|
@ -42,6 +42,10 @@ public class XssFilter implements GlobalFilter, Ordered
|
||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain)
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain)
|
||||||
{
|
{
|
||||||
ServerHttpRequest request = exchange.getRequest();
|
ServerHttpRequest request = exchange.getRequest();
|
||||||
|
// xss开关未开启 或 通过nacos关闭,不过滤
|
||||||
|
if(!xss.getEnabled()){
|
||||||
|
return chain.filter(exchange);
|
||||||
|
}
|
||||||
// GET DELETE 不过滤
|
// GET DELETE 不过滤
|
||||||
HttpMethod method = request.getMethod();
|
HttpMethod method = request.getMethod();
|
||||||
if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE)
|
if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue