Skip to content

fix(req): ignore trailing root dot in subdomains#7331

Open
lin-hongkuan wants to merge 1 commit into
expressjs:masterfrom
lin-hongkuan:codex/express-subdomains-trailing-dot
Open

fix(req): ignore trailing root dot in subdomains#7331
lin-hongkuan wants to merge 1 commit into
expressjs:masterfrom
lin-hongkuan:codex/express-subdomains-trailing-dot

Conversation

@lin-hongkuan

@lin-hongkuan lin-hongkuan commented Jun 24, 2026

Copy link
Copy Markdown

This strips an optional trailing DNS root dot before calculating req.subdomains, so fully qualified hostnames behave like their ordinary hostname form.

The regression test covers tobi.ferrets.example.com. and keeps existing subdomain offset behavior unchanged.

Validation:

  • npx mocha --require test/support/env --check-leaks test/req.subdomains.js
  • npm run lint
  • git diff --check

AI-assisted: Codex helped prepare this focused change; I reviewed the diff and ran the validation above before submitting.

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