Skip to content

Commit cdbafd3

Browse files
authored
dns: drop test depending on invalid URL "dns://::1/foo.bar.com" (#8716)
Go 1.26's url.Parse will reject invalid URLs containing unbracketed colons in the hostname. For example, Go 1.25 and earlier are willing to parse the URLs "https://localhost:80:443" (hostname:"localhost:80", port:443) and "https://::1" (hostname:":", port:1). The test TestCustomAuthority contains a case which depends on url.Parse("dns://::1/foo.bar.com") succeeding. In Go 1.26, this case will fail. Drop the test as not exercising a useful path: This URL is invalid and earlier Go versions being willing to parse it was a bug. The correct URL is "dns://[::1]/foo.bar.com" (which is also exercised by TestCustomAuthority). RELEASE NOTES: * client: Reject target URLs containing unbracketed colons in the hostname in Go version 1.26+.
1 parent 76c67d1 commit cdbafd3

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

internal/resolver/dns/dns_resolver_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,6 @@ func (s) TestCustomAuthority(t *testing.T) {
10511051
authority: "4.3.2.1",
10521052
wantAuthority: "4.3.2.1:53",
10531053
},
1054-
{
1055-
name: "ipv6 authority with no port",
1056-
authority: "::1",
1057-
wantAuthority: "[::1]:53",
1058-
},
10591054
{
10601055
name: "ipv6 authority with brackets and no port",
10611056
authority: "[::1]",

0 commit comments

Comments
 (0)