Add ip validation exclusion for IPv6 localhost ip (Ariel's testing server)
This commit is contained in:
parent
4b0d66985e
commit
1c64109862
@ -14,7 +14,16 @@ public class IpUtils {
|
|||||||
"([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
|
"([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
|
||||||
|
|
||||||
public static boolean isValidIp(String ip) {
|
public static boolean isValidIp(String ip) {
|
||||||
return ip != null && VALID_IP_PATTERN.matcher(ip).matches();
|
if (ip == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// :(
|
||||||
|
if (ip.equals("::1")) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return VALID_IP_PATTERN.matcher(ip).matches();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user