From edc20183bf7b9b7e9291f96830628036703f13a3 Mon Sep 17 00:00:00 2001 From: Breland Miley Date: Mon, 10 Dec 2018 15:43:48 -0600 Subject: [PATCH 1/2] Hostname can start with a number It's valid and legal for a hostname to start with a number. --- lib/revalidator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/revalidator.js b/lib/revalidator.js index 58476b0..dd2375d 100644 --- a/lib/revalidator.js +++ b/lib/revalidator.js @@ -129,7 +129,7 @@ //'style': (not supported) //'phone': (not supported) //'uri': (not supported) - 'host-name': /^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])/, + 'host-name': /^(([a-zA-Z0-9]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])/, 'utc-millisec': { test: function (value) { return typeof(value) === 'number' && value >= 0; From a35cee058997185ab55157b058f2650e64935eb9 Mon Sep 17 00:00:00 2001 From: Breland Miley Date: Tue, 11 Dec 2018 00:13:58 -0600 Subject: [PATCH 2/2] Update host-name regex to be more complete Dashes, numbers, etc. --- lib/revalidator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/revalidator.js b/lib/revalidator.js index dd2375d..9183109 100644 --- a/lib/revalidator.js +++ b/lib/revalidator.js @@ -129,7 +129,7 @@ //'style': (not supported) //'phone': (not supported) //'uri': (not supported) - 'host-name': /^(([a-zA-Z0-9]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])/, + 'host-name': /^(([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])/, 'utc-millisec': { test: function (value) { return typeof(value) === 'number' && value >= 0;