Skip to content

Update IPv6 parsing - #3334

Merged
david-crespo merged 6 commits into
mainfrom
update-ipv6-parsing
Aug 18, 2026
Merged

Update IPv6 parsing#3334
david-crespo merged 6 commits into
mainfrom
update-ipv6-parsing

Conversation

@charliepark

Copy link
Copy Markdown
Contributor

This updates our parsing / validating of IPv6 addresses, to make them more compliant with std::net::Ipv6Addr parsing. Instead of a regex, it uses the new URL() function as part of the evaluation.

Closes #1939

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Aug 18, 2026 8:24pm

Request Review

Comment thread app/util/ip.ts Outdated
function isIpv6(ip: string): boolean {
if (!ip.includes(':') || !IPV6_CHARS_REGEX.test(ip)) return false
try {
new URL(`http://[${ip}]`)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

WELL THAT'S CONVENIENT

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Worth a comment here that the brackets are what tell it it has to be an IP and not, e.g., a domain.

@david-crespo david-crespo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice

@david-crespo
david-crespo enabled auto-merge (squash) August 18, 2026 20:24
@david-crespo
david-crespo merged commit 218f3c0 into main Aug 18, 2026
7 checks passed
@david-crespo
david-crespo deleted the update-ipv6-parsing branch August 18, 2026 20:35
@charliepark charliepark added this to the 23 milestone Aug 18, 2026
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.

IPv6 regex doesn't exactly match std::net::Ipv6Addr parsing

2 participants