1
0
Fork 0

Enclose IPv6 addresses in "[]"

This commit is contained in:
herver 2018-06-13 08:06:03 +02:00 committed by Traefiker Bot
parent 2240bf9430
commit 2e95832812
2 changed files with 93 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import (
"crypto/sha1"
"encoding/base64"
"fmt"
"net"
"sort"
"strconv"
"strings"
@ -116,7 +117,7 @@ func (p *Provider) getServer(node *api.ServiceEntry) types.Server {
address := getBackendAddress(node)
return types.Server{
URL: fmt.Sprintf("%s://%s:%d", scheme, address, node.Service.Port),
URL: fmt.Sprintf("%s://%s", scheme, net.JoinHostPort(address, strconv.Itoa(node.Service.Port))),
Weight: p.getWeight(node.Service.Tags),
}
}