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:
parent
0786ae5449
commit
a65bf351bc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue