fix(apple): use all found system resolvers - #9991
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the system resolver validation logic for macOS and iOS where only the first found resolver was being processed instead of all available resolvers. The fix changes loop control flow to continue processing all resolvers rather than breaking after the first one.
- Replaces
breakstatements withcontinuestatements in resolver parsing loop - Ensures all system resolvers (both IPv4 and IPv6) are validated and added to the parsed resolvers list
| continue | ||
| } | ||
|
|
||
| if let ipv6Address = IPv6Address(stringAddress) { | ||
| parsedResolvers.append("\(ipv6Address)") | ||
| break | ||
| continue |
There was a problem hiding this comment.
[nitpick] The continue statement here is correct for processing all resolvers, but it's unnecessary since the code would naturally continue to the next iteration anyway. Consider removing this continue statement for cleaner code flow.
| continue | ||
| } | ||
|
|
||
| if let ipv6Address = IPv6Address(stringAddress) { | ||
| parsedResolvers.append("\(ipv6Address)") | ||
| break | ||
| continue |
There was a problem hiding this comment.
[nitpick] The continue statement here is correct for processing all resolvers, but it's unnecessary since the code would naturally continue to the next iteration anyway. Consider removing this continue statement for cleaner code flow.
Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
When validating the found system resolvers on macOS and iOS, we would stop after validating the first found resolver (usually IPv4) because
breakwas used instead ofcontinue.Fixes #9914