solon-security-web
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-security-web</artifactId>
</dependency>
1、描述
(v3.1.1 后支持)安全扩展插件,为 solon 提供 web 请求方面的安全过滤支持
请求头安全处理:
处理 | 描述 |
---|---|
CacheControlHeadersHandler | Cache-Control 头处理器 |
HstsHeaderHandler | Strict-Transport-Security 头处理器 |
XContentTypeOptionsHeaderHandler | X-Content-Type-Options 头处理器 |
XFrameOptionsHeaderHandler | X-Frame-Options 头处理器 |
XXssProtectionHeaderHandler | X-XSS-Protection 头处理器 |
2、使用示例
SecurityFilter 是个 web 过滤器,可以组织多种 Handler 处理。
@Configuration
public class DemoFilter {
@Bean(index = -99)
public SecurityFilter securityFilter() {
return new SecurityFilter(
new XContentTypeOptionsHeaderHandler(), //可选头处理
new XXssProtectionHeaderHandler()
);
}
}