Skip to content

Commit 04ddff9

Browse files
🐯 优化xss
1 parent 32faaca commit 04ddff9

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

CHANGELOG.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,35 @@
44
## [V1.3.1-RELEASE] 2019.10.15
55

66
### ⭐️ New Features
7-
7+
- Xss跨站脚本工具处理
8+
- CORS跨域配置
89

910
### ⚡️ Optimization
10-
11+
- 代码生成器可自定义配置生成哪些文件
12+
- 请求路径filter配置,配置文件属性名称调整
13+
- Aop切点优化,`Aop` JSON参数输出优化
14+
- 可配置是否生成`Validation`验证代码
15+
- 优化`controller`,`entity`模版生成
16+
- 优化代码生成器 CodeGenerator
17+
- 调整 `aop`, `filter`,`interceptor`,`controller`,`param`,`vo`代码目录结构
1118

1219
### 📝 Added/Modified
13-
20+
- Add `XssFilter`,`XssHttpServletRequestWrapper`,`XssJacksonDeserializer`,`XssJacksonSerializer`
21+
- Add `SpringBootPlusCorsProperties`
22+
- Update `JacksonConfig`
23+
- Update `LogAop`,`RequestPathFilter`,`ShiroConfig`
1424

1525
### 🐞 Bug Fixes
16-
26+
- fix druid控制面板无法访问问题
1727

1828
### 📔 Documentation
19-
29+
- [https://springboot.plus/guide/xss.html](https://springboot.plus/guide/xss.html)
30+
- [https://springboot.plus/guide/cors.html](https://springboot.plus/guide/cors.html)
2031

2132
### 🔨 Dependency Upgrades
2233
- Upgrade to `spring-boot` 2.1.9.RELEASE
2334
- Upgrade to `Fastjson` 1.2.62
24-
35+
- Add `commons-text` 1.8
2536

2637
## [V1.3.0-RELEASE] 2019.10.06
2738

src/main/java/io/geekidea/springbootplus/xss/XssHttpServletRequestWrapper.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ public XssHttpServletRequestWrapper(HttpServletRequest request) {
3737

3838
@Override
3939
public String getQueryString() {
40-
String value = super.getQueryString();
41-
return StringEscapeUtils.escapeHtml4(value);
40+
return StringEscapeUtils.escapeHtml4(super.getQueryString());
4241
}
4342

4443
@Override
4544
public String getParameter(String name) {
46-
String value = super.getParameter(name);
47-
return StringEscapeUtils.escapeHtml4(value);
45+
return StringEscapeUtils.escapeHtml4(super.getParameter(name));
4846
}
4947

5048
@Override
@@ -56,8 +54,7 @@ public String[] getParameterValues(String name) {
5654
int length = values.length;
5755
String[] escapeValues = new String[length];
5856
for (int i = 0; i < length; i++) {
59-
String value = values[i];
60-
escapeValues[i] = StringEscapeUtils.escapeHtml4(value);
57+
escapeValues[i] = StringEscapeUtils.escapeHtml4(values[i]);
6158
}
6259
return escapeValues;
6360
}

0 commit comments

Comments
 (0)