This commit is contained in:
parent
a09ae9fe4e
commit
f4f74224de
|
@ -8,7 +8,13 @@ function normalizeUrl(testUrl) {
|
|||
if (!parsed.protocol) {
|
||||
normalized = 'http://' + normalized;
|
||||
}
|
||||
if (!validator.isURL(normalized, {require_protocol: true, require_tld: false})) {
|
||||
|
||||
const validatorOptions = {
|
||||
require_protocol: true,
|
||||
require_tld: false,
|
||||
allow_trailing_dot: true // mDNS addresses, https://github.com/jiahaog/nativefier/issues/308
|
||||
};
|
||||
if (!validator.isURL(normalized, validatorOptions)) {
|
||||
throw `Your Url: "${normalized}" is invalid!`;
|
||||
}
|
||||
return normalized;
|
||||
|
|
Loading…
Reference in New Issue