//package kr.co.uplus.ez.config.filter;
//
//import java.io.IOException;
//
//import javax.servlet.FilterChain;
//import javax.servlet.FilterConfig;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//
//import org.springframework.util.AntPathMatcher;
//
//import kr.co.uplus.ez.common.xss.XssPreventer;
//import lguplus.security.vulner.FilterServlet;
//
//public class XssPreventFilter extends FilterServlet {
//
//    public FilterConfig filterConfig;
//
//    public void init(FilterConfig filterConfig) throws ServletException {
//        this.filterConfig = filterConfig;
//    }
//
//    public void destroy() {
//        this.filterConfig = null;
//    }
//
//    @Override
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
//            throws ServletException, IOException {
//        String path = ((HttpServletRequest) request).getServletPath();
//        if(!XssPreventer.EXCLUDE_URLS.stream()
//                .anyMatch(e -> new AntPathMatcher().match(e, path))) {
//            chain.doFilter(new XssPreventWrapper((HttpServletRequest) request), response);
//        } else {
//            chain.doFilter(request, response);
//        }
//    }
//
//}
