diff options
Diffstat (limited to 'caddy.go')
-rw-r--r-- | caddy.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -777,7 +777,10 @@ func IsInternal(addr string) bool { host, _, err := net.SplitHostPort(addr) if err != nil { - host = addr // happens if the addr is just a hostname + host = addr // happens if the addr is just a hostname, missing port + // if we encounter an error, the brackets need to be stripped + // because SplitHostPort didn't do it for us + host = strings.Trim(host, "[]") } ip := net.ParseIP(host) if ip == nil { |