Skip to content

Commit

Permalink
reuse auth split
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelSavignano committed Oct 28, 2021
1 parent 95d9bfe commit 7e6370d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/isURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ export default function isURL(url, options) {
if (split[0] === '') {
return false;
}
const [user, password] = split[0].split(':');
if (user === '' && password === '') {
return false;
}
auth = split.shift();
if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
return false;
}
const [user, password] = auth.split(':');
if (user === '' && password === '') {
return false;
}
}
hostname = split.join('@');

Expand Down

0 comments on commit 7e6370d

Please sign in to comment.