Model: Endpoint.hasHostAsIPAddress()
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
e992030569
commit
aa0b6e0c60
|
@ -75,3 +75,16 @@ extension Endpoint: Codable {
|
||||||
case invalidData
|
case invalidData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension Endpoint {
|
||||||
|
func hasHostAsIPAddress() -> Bool {
|
||||||
|
switch (host) {
|
||||||
|
case .name(_, _):
|
||||||
|
return false
|
||||||
|
case .ipv4(_):
|
||||||
|
return true
|
||||||
|
case .ipv6(_):
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue