import org.apache.commons.codec.Charsets;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.util.WebUtils;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;
import java.util.function.Predicate;
/**
* @author auono
*/
public class WebUtil extends WebUtils {
public static final String USER_AGENT_HEADER = "user-agent";
private static final String[] IP_HEADER_NAMES = new String[]{
"x-forwarded-for",
"Proxy-Client-IP",
"WL-Proxy-Cl