fix(data submit): Xss攻击

This commit is contained in:
xiaoyang 2021-06-01 20:58:06 +08:00
parent f28dd867ef
commit 655ec90906

View File

@ -14,11 +14,6 @@ import java.util.List;
*/
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
/**
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
*/
private static final List<String> noFilterNames = Arrays.asList("content");
/**
* @param request
*/
@ -29,7 +24,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
@Override
public String[] getParameterValues(String name) {
String[] values = super.getParameterValues(name);
if (!noFilterNames.contains(name) && values != null) {
if (values != null) {
int length = values.length;
String[] escapseValues = new String[length];
for (int i = 0; i < length; i++) {