Support IPv6 in minio command line (#6947)

Fixes #6946
This commit is contained in:
Harshavardhana
2018-12-13 23:37:46 -08:00
committed by Nitish Tiwari
parent 52b159b1db
commit bebaff269c
16 changed files with 273 additions and 77 deletions

View File

@@ -44,7 +44,7 @@ func (host Host) String() string {
return host.Name
}
return host.Name + ":" + host.Port.String()
return net.JoinHostPort(host.Name, host.Port.String())
}
// Equal - checks whether given host is equal or not.
@@ -129,6 +129,10 @@ func ParseHost(s string) (*Host, error) {
isPortSet = true
}
if i := strings.Index(host, "%"); i > -1 {
host = host[:i]
}
if !isValidHost(host) {
return nil, errors.New("invalid hostname")
}