diff --git a/client/pkg/srv/srv.go b/client/pkg/srv/srv.go index 21c377e352b..948c6834909 100644 --- a/client/pkg/srv/srv.go +++ b/client/pkg/srv/srv.go @@ -106,10 +106,9 @@ func GetClient(service, domain string, serviceName string) (*SRVClients, error) return err } for _, srv := range addrs { - shortHost := strings.TrimSuffix(srv.Target, ".") urls = append(urls, &url.URL{ Scheme: scheme, - Host: net.JoinHostPort(shortHost, fmt.Sprintf("%d", srv.Port)), + Host: net.JoinHostPort(srv.Target, fmt.Sprintf("%d", srv.Port)), }) } srvs = append(srvs, addrs...) diff --git a/client/pkg/srv/srv_test.go b/client/pkg/srv/srv_test.go index f5c84421b9d..c2ccf9485d9 100644 --- a/client/pkg/srv/srv_test.go +++ b/client/pkg/srv/srv_test.go @@ -226,8 +226,8 @@ func TestSRVDiscover(t *testing.T) { }, { []*net.SRV{ - {Target: "a.example.com.", Port: 2480}, - {Target: "b.example.com.", Port: 2480}, + {Target: "a.example.com", Port: 2480}, + {Target: "b.example.com", Port: 2480}, {Target: "c.example.com", Port: 2480}, }, []*net.SRV{},