mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
committed by
Nitish Tiwari
parent
52b159b1db
commit
bebaff269c
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user