From 00fa1c315828ab0cc64febbd6ca80e75ecf1ab2d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 28 Jul 2021 13:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AEXSS?= =?UTF-8?q?=E8=B7=A8=E7=AB=99=E8=84=9A=E6=9C=AC=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java index fff2444..799625f 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java @@ -2,6 +2,7 @@ package com.ruoyi.gateway.filter; import java.nio.charset.StandardCharsets; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.core.Ordered; @@ -27,6 +28,7 @@ import reactor.core.publisher.Mono; * @author ruoyi */ @Component +@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true") public class XssFilter implements GlobalFilter, Ordered { // 跨站脚本的 xss 配置,nacos自行添加