validators: Allow only lowercase characters for hostname

Validation error mentions only lowercase characters, this updates the regex accordingly.
This commit is contained in:
regexowl 2024-12-12 10:25:13 +01:00 committed by Michal Gold
parent 3bd4dc89c4
commit 9b6934438a

View file

@ -98,7 +98,7 @@ export const isHostnameValid = (hostname: string) => {
return (
hostname.length < 65 &&
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/.test(
/^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/.test(
hostname
)
);