mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Allow IPv6 address without port (fixes #80)
This commit is contained in:
parent
e42c6ab520
commit
5e8491cf7f
1 changed files with 3 additions and 2 deletions
|
@ -265,11 +265,12 @@ func standardAddress(str string) (host, port string, err error) {
|
||||||
} else if strings.HasPrefix(str, "http://") {
|
} else if strings.HasPrefix(str, "http://") {
|
||||||
schemePort = "http"
|
schemePort = "http"
|
||||||
str = str[7:]
|
str = str[7:]
|
||||||
} else if !strings.Contains(str, ":") {
|
|
||||||
str += ":" // + Port
|
|
||||||
}
|
}
|
||||||
|
|
||||||
host, port, err = net.SplitHostPort(str)
|
host, port, err = net.SplitHostPort(str)
|
||||||
|
if err != nil {
|
||||||
|
host, port, err = net.SplitHostPort(str + ":") // tack on empty port
|
||||||
|
}
|
||||||
if err != nil && schemePort != "" {
|
if err != nil && schemePort != "" {
|
||||||
host = str
|
host = str
|
||||||
port = schemePort // assume port from scheme
|
port = schemePort // assume port from scheme
|
||||||
|
|
Loading…
Reference in a new issue