Add validation for Endpoints
This commit is contained in:
@@ -91,7 +91,7 @@ func IsValidPortNum(port int) bool {
|
||||
return 0 < port && port < 65536
|
||||
}
|
||||
|
||||
// IsValidIP tests that the argument is a valid IPv4 address.
|
||||
func IsValidIP(value string) bool {
|
||||
// IsValidIPv4 tests that the argument is a valid IPv4 address.
|
||||
func IsValidIPv4(value string) bool {
|
||||
return net.ParseIP(value) != nil && net.ParseIP(value).To4() != nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user