Skip to content

fix: handle IPv4-mapped IPv6 addresses in req.subdomains - #7589

Closed
ebenyoub wants to merge 1 commit into
expressjs:masterfrom
ebenyoub:fix/ipv4-mapped-ipv6-subdomains
Closed

ebenyoub wants to merge 1 commit into
expressjs:masterfrom
ebenyoub:fix/ipv4-mapped-ipv6-subdomains

Conversation

@ebenyoub

@ebenyoub ebenyoub commented Nov 5, 2026

Copy link
Copy Markdown

Summary

Fixes incorrect subdomain parsing for bracketed IPv4-mapped IPv6 addresses, such as [::ffff:192.168.1.10].

The req.subdomains getter now removes the surrounding brackets before checking whether the hostname is an IP address, while preserving the original hostname in the result.

Tests

  • Added a regression test for IPv4-mapped IPv6 addresses with subdomain offset set to 0.
  • Verified all 12 tests in test/req.subdomains.js.
  • Verified the full Express test suite locally.

@krzysdz

krzysdz commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #7533

@krzysdz krzysdz marked this as a duplicate of #7533 Nov 5, 2026
@krzysdz krzysdz closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants