mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-27 20:09:03 +00:00
This commit is contained in:
parent
a09ae9fe4e
commit
f4f74224de
@ -8,7 +8,13 @@ function normalizeUrl(testUrl) {
|
|||||||
if (!parsed.protocol) {
|
if (!parsed.protocol) {
|
||||||
normalized = 'http://' + normalized;
|
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!`;
|
throw `Your Url: "${normalized}" is invalid!`;
|
||||||
}
|
}
|
||||||
return normalized;
|
return normalized;
|
||||||
|
Loading…
Reference in New Issue
Block a user