File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default function isURL(url, options) {
100100 return false ;
101101 }
102102 auth = split . shift ( ) ;
103- if ( auth . indexOf ( ':' ) >= 0 && auth . split ( ':' ) . length > 2 ) {
103+ if ( auth . indexOf ( ':' ) === - 1 || ( auth . indexOf ( ':' ) >= 0 && auth . split ( ':' ) . length > 2 ) ) {
104104 return false ;
105105 }
106106 }
Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ describe('Validators', () => {
339339 'http://[::FFFF:129.144.52.38]:80/index.html' ,
340340 'http://[2010:836B:4179::836B:4179]' ,
341341 'http://example.com/example.json#/foo/bar' ,
342+ 'http://user:@www.foobar.com' ,
342343 ] ,
343344 invalid : [
344345 'http://localhost:3000/' ,
@@ -379,6 +380,7 @@ describe('Validators', () => {
379380 '////foobar.com' ,
380381 'http:////foobar.com' ,
381382 'https://example.com/foo/<script>alert(\'XSS\')</script>/' ,
383+ 382384 ] ,
383385 } ) ;
384386 } ) ;
You can’t perform that action at this time.
0 commit comments