Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: 张洁俊(Jack) <zhang.jiejun@outlook.com>
  • Loading branch information
张洁俊(Jack) committed Jan 22, 2024
1 parent 6c17293 commit 06d3c1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions opensearchtransport/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ func (c *Client) getNodeURL(node nodeInfo, scheme string) *url.URL {
host = strings.Split(addrs[0], ":")[0]
}
}

port = ports[len(ports)-1]
if len(port) == 0 {
port = ports[len(ports)-1]
}

u := &url.URL{
Scheme: scheme,
Host: net.JoinHostPort(host, port),
Expand Down

0 comments on commit 06d3c1c

Please sign in to comment.