From 132f1e2be1ef123c104c6a43fad652a3a856d54f Mon Sep 17 00:00:00 2001 From: vivekmahindrakar Date: Sun, 20 Oct 2024 19:56:10 +0530 Subject: [PATCH] fix #2448 : isUrl fails for URLs that do not use domain suffixes --- src/lib/isURL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isURL.js b/src/lib/isURL.js index 7529f4bde..a317b81d5 100644 --- a/src/lib/isURL.js +++ b/src/lib/isURL.js @@ -85,7 +85,7 @@ export default function isURL(url, options) { split = url.split('://'); if (split.length > 1) { protocol = split.shift().toLowerCase(); - if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) { + if (options.require_valid_protocol && !protocol) { return false; } } else if (options.require_protocol) {