Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Quentin McGaw
2026-06-04 19:16:25 +02:00
committed by GitHub
parent 8f0764575b
commit 81be2675b2
+4 -1
View File
@@ -336,11 +336,14 @@ func (r *udpRouter) writeClientPacketToDestination(ctx context.Context,
return fmt.Errorf("splitting destination host and port: %w", err)
}
if _, err := netip.ParseAddr(destination); err != nil { // domain name
if _, err := netip.ParseAddr(host); err != nil { // domain name
addrs, err := net.DefaultResolver.LookupHost(ctx, host)
if err != nil {
return fmt.Errorf("resolving destination host: %w", err)
}
if len(addrs) == 0 {
return fmt.Errorf("resolving destination host: no addresses found for %q", host)
}
destination = net.JoinHostPort(addrs[0], portStr)
}