mirror of
https://github.com/minio/minio.git
synced 2025-04-01 02:03:42 -04:00
Strip standard ports off remote target url (#10498)
This commit is contained in:
parent
03490c811b
commit
00555c747e
@ -118,7 +118,15 @@ func (t BucketTarget) URL() string {
|
|||||||
if t.Secure {
|
if t.Secure {
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s://%s", scheme, t.Endpoint)
|
urlStr := fmt.Sprintf("%s://%s", scheme, t.Endpoint)
|
||||||
|
u, err := url.Parse(urlStr)
|
||||||
|
if err != nil {
|
||||||
|
return urlStr
|
||||||
|
}
|
||||||
|
if u.Port() == "80" || u.Port() == "443" {
|
||||||
|
u.Host = u.Hostname()
|
||||||
|
}
|
||||||
|
return u.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty returns true if struct is empty.
|
// Empty returns true if struct is empty.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user