Skip to content

dns: drop test depending on invalid URL "dns://::1/foo.bar.com"#8716

Merged
easwars merged 1 commit intogrpc:masterfrom
neild:colonport
Nov 21, 2025
Merged

dns: drop test depending on invalid URL "dns://::1/foo.bar.com"#8716
easwars merged 1 commit intogrpc:masterfrom
neild:colonport

Conversation

@neild
Copy link
Copy Markdown
Contributor

@neild neild commented Nov 19, 2025

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+.

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
Copy link
Copy Markdown

codecov Bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.25%. Comparing base (50c6321) to head (23b996c).
⚠️ Report is 2 commits behind head on master.

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     

see 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@arjan-bal arjan-bal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arjan-bal arjan-bal requested a review from easwars November 20, 2025 07:14
@arjan-bal arjan-bal added Type: Behavior Change Behavior changes not categorized as bugs Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. labels Nov 20, 2025
@arjan-bal arjan-bal added this to the 1.78 Release milestone Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. Type: Behavior Change Behavior changes not categorized as bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants