From de657ea220ff7b9d5abf87cd1dd1bd0809a17ab7 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Fri, 11 Jul 2014 19:16:09 +0000 Subject: [PATCH] make consumer lookupd_http_address handling work like pynsq would fail if scheme was present, but path was completely blank (not even just /) --- consumer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/consumer.go b/consumer.go index 2325bfe8..7ed5b82a 100644 --- a/consumer.go +++ b/consumer.go @@ -330,15 +330,15 @@ func (r *Consumer) nextLookupdEndpoint() string { r.lookupdQueryIndex = (r.lookupdQueryIndex + 1) % num urlString := addr - if !strings.Contains(urlString, "/") { - urlString = fmt.Sprintf("http://%s/", addr) + if !strings.Contains(urlString, "://") { + urlString = "http://" + addr } u, err := url.Parse(urlString) if err != nil { panic(err) } - if u.Path == "/" { + if u.Path == "/" || u.Path == "" { u.Path = "/lookup" }