Search in sources :

Example 1 with TokenServletRequestWrapperWithFile

use of com.tony.billing.filters.wapper.TokenServletRequestWrapperWithFile in project BillingDubbo by TonyJiangWJ.

the class XssTokenizeFilter method doFilterInternal.

@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
    TokenServletRequestWrapper request;
    if (StringUtils.equals(httpServletRequest.getContentType(), MULTIPART_CONTENT)) {
        request = new TokenServletRequestWrapperWithFile(new CommonsMultipartResolver().resolveMultipart(httpServletRequest));
    } else {
        request = new TokenServletRequestWrapper(httpServletRequest);
    }
    filterChain.doFilter(request, httpServletResponse);
}
Also used : CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) TokenServletRequestWrapperWithFile(com.tony.billing.filters.wapper.TokenServletRequestWrapperWithFile) TokenServletRequestWrapper(com.tony.billing.filters.wapper.TokenServletRequestWrapper)

Aggregations

TokenServletRequestWrapper (com.tony.billing.filters.wapper.TokenServletRequestWrapper)1 TokenServletRequestWrapperWithFile (com.tony.billing.filters.wapper.TokenServletRequestWrapperWithFile)1 CommonsMultipartResolver (org.springframework.web.multipart.commons.CommonsMultipartResolver)1