// ip 체크
String ip = request.getHeader("X-Forwarded-For");
if (ip == null) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null) {
ip = request.getRemoteAddr();
}
// 모바일 체크
String userAgent = request.getHeader("user-agent");
boolean mobile1 = userAgent.matches(".*(iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson).*");
boolean mobile2 = userAgent.matches(".*(LG|SAMSUNG|Samsung).*");
if(mobile1 || mobile2) return true;