Skip to content

Commit

Permalink
Call SplitHostPort only when domain has a port
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Nov 25, 2021
1 parent ac13522 commit 2d3f2ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/e2e/grpc_test.go
Expand Up @@ -73,10 +73,12 @@ func dial(ctx *TestContext, host, domain string) (*grpc.ClientConn, error) {
if !hasPort(host) {
host = net.JoinHostPort(host, defaultPort)
}
var err error
domain, _, err = net.SplitHostPort(domain)
if err != nil {
return nil, err
if hasPort(domain) {
var err error
domain, _, err = net.SplitHostPort(domain)
if err != nil {
return nil, err
}
}

secureOpt := grpc.WithInsecure()
Expand Down

0 comments on commit 2d3f2ed

Please sign in to comment.