Skip to content

Commit

Permalink
Remove the dot
Browse files Browse the repository at this point in the history
  • Loading branch information
verejoel committed Jun 28, 2024
1 parent 2e58c8c commit 0fcd6ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/discovery/dns/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package dns

import (
"context"
"fmt"
"net"
"strconv"
"strings"
Expand Down Expand Up @@ -109,8 +108,9 @@ func (s *dnsSD) Resolve(ctx context.Context, name string, qtype QType) ([]string
}

if qtype == SRVNoA {
fmt.Printf("Hello: %s", rec.Target)
res = append(res, appendScheme(scheme, net.JoinHostPort(rec.Target, resPort)))
// Remove the final dot from rooted DNS names to make them look more usual.
target := strings.TrimRight(rec.Target, ".")
res = append(res, appendScheme(scheme, net.JoinHostPort(target, resPort)))
continue
}
// Do A lookup for the domain in SRV answer.
Expand Down

0 comments on commit 0fcd6ed

Please sign in to comment.