From 5e8491cf7f47fd9f2423536bbb1a6ea21fae8bb6 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 20 May 2015 20:15:39 -0600 Subject: [PATCH] Allow IPv6 address without port (fixes #80) --- config/parse/parsing.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/parse/parsing.go b/config/parse/parsing.go index 8eb2c12c6..d16ae6f61 100644 --- a/config/parse/parsing.go +++ b/config/parse/parsing.go @@ -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