dns: drop test depending on invalid URL "dns://::1/foo.bar.com"#8716
Merged
easwars merged 1 commit intogrpc:masterfrom Nov 21, 2025
Merged
dns: drop test depending on invalid URL "dns://::1/foo.bar.com"#8716easwars merged 1 commit intogrpc:masterfrom
easwars merged 1 commit intogrpc:masterfrom
Conversation
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).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8716 +/- ##
==========================================
+ Coverage 83.21% 83.25% +0.03%
==========================================
Files 419 419
Lines 32427 32427
==========================================
+ Hits 26985 26997 +12
+ Misses 4054 4050 -4
+ Partials 1388 1380 -8 🚀 New features to boost your workflow:
|
arjan-bal
approved these changes
Nov 20, 2025
Contributor
arjan-bal
left a comment
There was a problem hiding this comment.
LGTM. If I understand correctly, the change in url.Parse means gRPC will also reject unbracketed colons in the hostname. I believe this is fine since gRPC should remain consistent with the standard library. Adding another reviewer for confirmation.
easwars
approved these changes
Nov 21, 2025
This was referenced Apr 23, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: