Skip to content

Commit

Permalink
Fix url parsing that caused v1 test to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
croomes committed Mar 11, 2020
1 parent 19f3d91 commit b73caed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netutil/parsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ func AddressesFromNodes(nodes []string) ([]string, error) {
return nil, newInvalidNodeError(errInvalidHostName)
}

// Given input like "http://localhost:8080:8383", url.Parse() will
// return host as "localhost:8000", which isn't a vaild DNS name.
if strings.Contains(host, ":") {
return nil, newInvalidNodeError(errInvalidHostName)
}

port := url.Port()
if port == "" {
port = DefaultDialPort
Expand Down

0 comments on commit b73caed

Please sign in to comment.