File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const url = require('url')
2323const isValidUrl = u => {
2424 if ( u && typeof u === 'string' ) {
2525 const p = url . parse ( u )
26- return ! ! ( p . protocol && p . slashes && p . host && p . path )
26+ return p . slashes && p . host && p . path && / ^ h t t p s ? : $ / . test ( p . protocol )
2727 }
2828 return false
2929}
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ const server = http.createServer((q, s) => {
137137
138138 case '/invalid-login-url/-/v1/login' :
139139 return respond ( s , 200 , {
140- loginUrl : 'this is not a url ' ,
140+ loginUrl : 'ftp:// this.is/ not-a-webpage/now/is/it? ' ,
141141 doneUrl : reg + '/invalid-done/-/v1/login'
142142 } )
143143
@@ -418,7 +418,7 @@ t.test('fail at login step by having an invalid url', t => {
418418 method : 'POST' ,
419419 uri : reg + '/invalid-login-url/-/v1/login' ,
420420 body : {
421- loginUrl : 'this is not a url ' ,
421+ loginUrl : 'ftp:// this.is/ not-a-webpage/now/is/it? ' ,
422422 doneUrl : reg + '/invalid-done/-/v1/login'
423423 } ,
424424 message : 'Invalid response from web login endpoint'
You can’t perform that action at this time.
0 commit comments