Merge pull request #1205 from balena-io/better-.local-detection

Allow any amount of subdomains when parsing .local addresses
This commit is contained in:
CameronDiver 2019-05-01 09:14:36 +01:00 committed by GitHub
commit 5f67c243c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ const APPNAME_REGEX = new RegExp(/^[a-zA-Z0-9_-]+$/);
const IP_REGEX = new RegExp(
/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,
);
const DOTLOCAL_REGEX = new RegExp(/^[a-zA-Z0-9-]+\.local$/);
const DOTLOCAL_REGEX = new RegExp(/^([a-zA-Z0-9-]+\.)+local$/);
export function validateEmail(input: string) {
if (!validEmail(input)) {