use svchost.IsValid for FriendlyHost.Valid

This commit is contained in:
James Bardin 2017-10-25 17:10:15 -04:00
parent 54c5aab7ef
commit 0a673fa5ef
1 changed files with 1 additions and 10 deletions

View File

@ -95,16 +95,7 @@ func ParseFriendlyHost(source string) (host *FriendlyHost, rest string) {
// name specifications. Not that IDN prefixes containing punycode are not valid
// input which we expect to always be in user-input or normalised display form.
func (h *FriendlyHost) Valid() bool {
if h.Display() == InvalidHostString {
return false
}
if h.Normalized() == InvalidHostString {
return false
}
if containsPuny(h.Raw) {
return false
}
return true
return svchost.IsValid(h.Raw)
}
// Display returns the host formatted for display to the user in CLI or web