Skip to content

fix: handle multi-address lookups for WKD on Node 20+ - #617

Open
uniejo wants to merge 1 commit into
forwardemail:masterfrom
uniejo:fix/wkd-lookup-node20
Open

uniejo wants to merge 1 commit into
forwardemail:masterfrom
uniejo:fix/wkd-lookup-node20

Conversation

@uniejo

@uniejo uniejo commented Oct 12, 2026 •

Copy link
Copy Markdown

Node 20+ calls the connect-time lookup with all: true (autoSelectFamily), and the resolver then returns an array of addresses. The lookup read .address of that array, so every WKD fetch failed with ERR_INVALID_IP_ADDRESS and the private address check was skipped.

All addresses are now requested from the resolver and each one is checked before any is used, then returned in the form Node asked for.

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

Node 20+ calls the connect-time lookup with `all: true`
(autoSelectFamily), and the resolver then returns an array of
addresses.  The lookup read `.address` of that array, so every WKD
fetch failed with ERR_INVALID_IP_ADDRESS and the private address
check was skipped.

All addresses are now requested from the resolver and each one is
checked before any is used, then returned in the form Node asked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant