mirror of
https://github.com/minio/minio.git
synced 2026-02-05 02:10:14 -05:00
go1.8: Changes to support golang 1.8 (#4759)
QuirkConn is added to replace net.Conn as a workaround to a golang bug: https://github.com/golang/go/issues/21133
This commit is contained in:
committed by
Harshavardhana
parent
218049300c
commit
b4dc6df35c
16
cmd/net.go
16
cmd/net.go
@@ -198,18 +198,20 @@ func extractHostPort(hostAddr string) (string, string, error) {
|
||||
return "", "", errors.New("unable to process empty address")
|
||||
}
|
||||
|
||||
// Simplify the work of url.Parse() and always send a url with
|
||||
if !strings.HasPrefix(hostAddr, "http://") && !strings.HasPrefix(hostAddr, "https://") {
|
||||
hostAddr = "//" + hostAddr
|
||||
}
|
||||
|
||||
// Parse address to extract host and scheme field
|
||||
u, err := url.Parse(hostAddr)
|
||||
if err != nil {
|
||||
// Ignore scheme not present error
|
||||
if !strings.Contains(err.Error(), "missing protocol scheme") {
|
||||
return "", "", err
|
||||
}
|
||||
} else {
|
||||
addr = u.Host
|
||||
scheme = u.Scheme
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
addr = u.Host
|
||||
scheme = u.Scheme
|
||||
|
||||
// Use the given parameter again if url.Parse()
|
||||
// didn't return any useful result.
|
||||
if addr == "" {
|
||||
|
||||
Reference in New Issue
Block a user