Allow intranet URLs

This could be a great way to package intranet applications into electron apps. Added `require_tld` validator config setting to allow those intranet locations without a TLD to be packaged.
This commit is contained in:
Matt Prestlien 2016-01-20 08:54:05 -08:00
parent 0786ae5449
commit a65bf351bc
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ function normalizeUrl(testUrl) {
if (!parsed.protocol) {
normalized = 'http://' + normalized;
}
if (!validator.isURL(normalized, {require_protocol: true})) {
if (!validator.isURL(normalized, {require_protocol: true, require_tld: true})) {
throw `Your Url: "${normalized}" is invalid!`;
}
return normalized;