Skip to content

Commit

Permalink
Merge pull request #63 from ploxiln/lookupd_address_no_path_63
Browse files Browse the repository at this point in the history
handle lookupd_http_address like pynsq
  • Loading branch information
jehiah committed Jul 11, 2014
2 parents 256c0c8 + de657ea commit 143aa3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit 143aa3e

Please sign in to comment.