Skip to content

Commit

Permalink
fix validatorjs#2448 : isUrl fails for URLs that do not use domain su…
Browse files Browse the repository at this point in the history
…ffixes
  • Loading branch information
vivekmahindrakar committed Oct 20, 2024
1 parent 12b27a2 commit 132f1e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 132f1e2

Please sign in to comment.