|
|
@ -23,7 +23,10 @@ public class IpAddressUtils { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static String getIpAddress(HttpServletRequest request) { |
|
|
|
public static String getIpAddress(HttpServletRequest request) { |
|
|
|
String ip = request.getHeader("x-forwarded-for"); |
|
|
|
String ip = request.getHeader("X-Real-IP"); |
|
|
|
|
|
|
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
|
|
|
|
|
|
|
ip = request.getHeader("x-forwarded-for"); |
|
|
|
|
|
|
|
} |
|
|
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
|
|
|
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
|
|
|
ip = request.getHeader("Proxy-Client-IP"); |
|
|
|
ip = request.getHeader("Proxy-Client-IP"); |
|
|
|
} |
|
|
|
} |
|
|
|