diff --git a/repo/grpc_repository_client.go b/repo/grpc_repository_client.go index 80d6f4407..ba568ac2f 100644 --- a/repo/grpc_repository_client.go +++ b/repo/grpc_repository_client.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "io" + "net" "net/url" "runtime" "sync" @@ -837,7 +838,7 @@ func openGRPCAPIRepository(ctx context.Context, si *APIServerInfo, password stri return nil, errors.Errorf("invalid server address, must be 'https://host:port' or 'unix+https://") } - uri := u.Hostname() + ":" + u.Port() + uri := net.JoinHostPort(u.Hostname(), u.Port()) if u.Scheme == "unix+https" { uri = "unix:" + u.Path }