Commit 5e8491cf authored by Matthew Holt's avatar Matthew Holt

Allow IPv6 address without port (fixes #80)

parent e42c6ab5
......@@ -265,11 +265,12 @@ func standardAddress(str string) (host, port string, err error) {
} else if strings.HasPrefix(str, "http://") {
schemePort = "http"
str = str[7:]
} else if !strings.Contains(str, ":") {
str += ":" // + Port
}
host, port, err = net.SplitHostPort(str)
if err != nil {
host, port, err = net.SplitHostPort(str + ":") // tack on empty port
}
if err != nil && schemePort != "" {
host = str
port = schemePort // assume port from scheme
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment