Skip to content

fix(httpUrl): allow underscores in hostname - #6273

Open
deepshekhardas wants to merge 2 commits into
colinhacks:mainfrom
deepshekhardas:fix/underscore-http-hostname
Open

fix(httpUrl): allow underscores in hostname#6273
deepshekhardas wants to merge 2 commits into
colinhacks:mainfrom
deepshekhardas:fix/underscore-http-hostname

Conversation

@deepshekhardas

Copy link
Copy Markdown

Fixes #5960.

Problem

z.httpUrl() rejects hostnames containing underscores (e.g., https://julia_artberg.artstation.com/ or https://exa_mple.com/), even though underscores are commonly used in real-world URLs.

Root cause

The domain regex used by httpUrl() for hostname validation only allows letters, digits, and hyphens in each label. Underscores (_) are excluded.

Fix

Added _ to the allowed character set in the domain regex — both for the start/end of each label ([a-zA-Z0-9_]) and for the middle positions ([a-zA-Z0-9_-]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant