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 06d3c1c commit 3d68c23
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions opensearchtransport/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,12 @@ func (c *Client) getNodeURL(node nodeInfo, scheme string) *url.URL {
if len(addrs) > 1 {
host = addrs[0]
} else {
host, port, err = net.SplitHostPort(addrs[0])
host, _, err = net.SplitHostPort(addrs[0])
if err != nil {
host = strings.Split(addrs[0], ":")[0]
}
}
if len(port) == 0 {
port = ports[len(ports)-1]
}

port = ports[len(ports)-1]
u := &url.URL{
Scheme: scheme,
Host: net.JoinHostPort(host, port),
Expand Down

0 comments on commit 3d68c23

Please sign in to comment.