Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -45,6 +45,11 @@ public class IpUtils {
|
||||
public static String getRealIpAddress(ServerHttpRequest request) {
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
String ipAddress = headers.getFirst(HEADER_X_FORWARDED_FOR);
|
||||
log.error("X-Forwarded-For:"+ipAddress);
|
||||
ipAddress = headers.getFirst("X-Real-IP");
|
||||
log.error("X-Real-IP:"+ipAddress);
|
||||
ipAddress = headers.getFirst("Proxy-Client-IP");
|
||||
log.error("Proxy-Client-IP:"+ipAddress);
|
||||
if (StrUtil.isBlankIfStr(ipAddress) || UNKNOWN.equalsIgnoreCase(ipAddress)) {
|
||||
ipAddress = headers.getFirst(HEADER_PROXY_CLIENT_IP);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user