improve cmd
This commit is contained in:
@ -74,9 +74,12 @@ func (r *Router) resolve(ctx context.Context, addr string) (string, error) {
|
||||
}
|
||||
|
||||
host, port, err := net.SplitHostPort(addr)
|
||||
if err != nil || host == "" {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if host == "" {
|
||||
return addr, nil
|
||||
}
|
||||
|
||||
if r.Hosts != nil {
|
||||
if ips, _ := r.Hosts.Lookup("ip", host); len(ips) > 0 {
|
||||
|
Reference in New Issue
Block a user