Skip to content

Commit bbc2554

Browse files
committed
fix(@angular/ssr): allow underscores in host validation
The VALID_HOST_REGEX has been updated to include the underscore character. This ensures that hostnames containing underscores (e.g., in some internal or development environments) are correctly validated instead of being rejected. Closes angular#32835 (cherry picked from commit e7e434c)
1 parent 88ac998 commit bbc2554

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/ssr/src/utils/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const VALID_PROTO_REGEX = /^https?$/i;
2424
/**
2525
* Regular expression to validate that the host is a valid hostname.
2626
*/
27-
const VALID_HOST_REGEX = /^[a-z0-9.:-]+$/i;
27+
const VALID_HOST_REGEX = /^[a-z0-9_.-]+(:[0-9]+)?$/i;
2828

2929
/**
3030
* Regular expression to validate that the prefix is valid.

0 commit comments

Comments
 (0)