mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-24 13:54:05 +08:00
Trim
This commit is contained in:
parent
8f41944fcf
commit
5f4614b643
@ -394,7 +394,7 @@ func SplitNetworkAddress(a string) (network, host, port string, err error) {
|
||||
// so try removing square brackets around an IPv6 host, adding a bogus
|
||||
// port to take advantage of standard library's robust parser, then
|
||||
// strip the artificial port.
|
||||
host, _, err = net.SplitHostPort(net.JoinHostPort(strings.TrimPrefix(a, "[]"), "0"))
|
||||
host, _, err = net.SplitHostPort(net.JoinHostPort(strings.Trim(a, "[]"), "0"))
|
||||
port = ""
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user