package org.springblade.common.filter;

import cn.hutool.extra.servlet.ServletUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.filter.utils.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
import java.util.Map;

/**
 * @author cy-computer
 */
@Component
@WebFilter(urlPatterns = {"/*"}, filterName = "decryptFilter")
public class DecryptFilter  implements Filter {

	@Resource
	private HttpUtil httpUtil;

	@SneakyThrows
	@Override
	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
		httpUtil.modifyHttpData(servletRequest,servletResponse,filterChain);
	}
}
