mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
Handle localhost distributed setups properly (#8577)
Fixes an issue reported by @klauspost and @vadmeste This PR also allows users to expand their clusters from single node XL deployment to distributed mode.
This commit is contained in:
+14
-3
@@ -126,12 +126,23 @@ func ParseURL(s string) (u *URL, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if uu.Host == "" {
|
||||
if uu.Hostname() == "" {
|
||||
if uu.Scheme != "" {
|
||||
return nil, errors.New("scheme appears with empty host")
|
||||
}
|
||||
} else if _, err = ParseHost(uu.Host); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
portStr := uu.Port()
|
||||
if portStr == "" {
|
||||
switch uu.Scheme {
|
||||
case "http":
|
||||
portStr = "80"
|
||||
case "https":
|
||||
portStr = "443"
|
||||
}
|
||||
}
|
||||
if _, err = ParseHost(net.JoinHostPort(uu.Hostname(), portStr)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Clean path in the URL.
|
||||
|
||||
Reference in New Issue
Block a user