Files
xiaozhi-esp32-server/main/manager-api/src/main/java/xiaozhi/common/xss/XssConfig.java
T
0e43748fdc 重新划分目录 (#214)
* 🦄 refactor(web): 修改zhikongtaiweb到web

* 🦄 refactor: 重写前端

路由守护尚未写完

* 🦄 refactor: 标准化路由

* update:前端重写,保留后端

* update:添加前端代码

* update:pip转成poetry启动

* update:增加mem0ai包依赖

* update:文档增加mem0ai的描述

* feat: play online mp3 (#181)

Co-authored-by: 欣南科技 <huangrongzhuang@xin-nan.com>

* 修改前端代码

* update:调整项目目录

* update:优化

* update:配置文件去除8002端口

* update:增加开发说明

* update:更新开发协议

---------

Co-authored-by: kalicyh <34980061+kaliCYH@users.noreply.github.com>
Co-authored-by: hrz <1710360675@qq.com>
Co-authored-by: freshlife001 <talent@mises.site>
Co-authored-by: CGD <3030332422@qq.com>
2025-03-05 23:13:24 +08:00

33 lines
1.2 KiB
Java

package xiaozhi.common.xss;
import jakarta.servlet.DispatcherType;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.PathMatcher;
/**
* XSS 配置文件
* Copyright (c) 人人开源 All rights reserved.
* Website: https://www.renren.io
*/
@Configuration
@EnableConfigurationProperties(XssProperties.class)
@ConditionalOnProperty(prefix = "renren.xss", value = "enabled")
public class XssConfig {
@Bean
public FilterRegistrationBean<XssFilter> xssFilter(XssProperties properties, PathMatcher pathMatcher) {
FilterRegistrationBean<XssFilter> bean = new FilterRegistrationBean<>();
bean.setDispatcherTypes(DispatcherType.REQUEST);
bean.setFilter(new XssFilter(properties, pathMatcher));
bean.addUrlPatterns("/*");
bean.setOrder(Integer.MAX_VALUE);
bean.setName("xssFilter");
return bean;
}
}