Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular/ssr/src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const VALID_PROTO_REGEX = /^https?$/i;
/**
* Regular expression to validate that the host is a valid hostname.
*/
const VALID_HOST_REGEX = /^[a-z0-9.:-]+$/i;
const VALID_HOST_REGEX = /^[a-z0-9_.-]+(:[0-9]+)?$/i;
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.

Question: Can you start a hostname with a -, _, or .? Do we care to be that specific? Might be fine to allow at this layer even if it fails elsewhere.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, but this is more of checking for invalid characters.


/**
* Regular expression to validate that the prefix is valid.
Expand Down
Loading