|
|
|
@ -1,11 +1,3 @@ |
|
|
|
/** |
|
|
|
* Copyright (c) 2016-2019 人人开源 All rights reserved. |
|
|
|
* |
|
|
|
* https://www.renren.io
|
|
|
|
* |
|
|
|
* 版权所有,侵权必究! |
|
|
|
*/ |
|
|
|
|
|
|
|
package cn.chjyj.szwh.xss; |
|
|
|
|
|
|
|
import javax.servlet.*; |
|
|
|
@ -14,8 +6,6 @@ import java.io.IOException; |
|
|
|
|
|
|
|
/** |
|
|
|
* XSS过滤 |
|
|
|
* |
|
|
|
* @author Mark sunlightcs@gmail.com |
|
|
|
*/ |
|
|
|
public class XssFilter implements Filter { |
|
|
|
|
|
|
|
@ -23,6 +13,14 @@ public class XssFilter implements Filter { |
|
|
|
public void init(FilterConfig config) throws ServletException { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 过滤请求中的有害字符串 |
|
|
|
* @param request |
|
|
|
* @param response |
|
|
|
* @param chain |
|
|
|
* @throws IOException |
|
|
|
* @throws ServletException |
|
|
|
*/ |
|
|
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
|
|
|
throws IOException, ServletException { |
|
|
|
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( |
|
|
|
|