use match in one case and remove and operator

This commit is contained in:
Nate Stemen 2018-08-27 16:48:44 -04:00
parent 4d991aa176
commit 465b9aefc5
2 changed files with 2 additions and 2 deletions

View file

@ -50,7 +50,7 @@ module.exports = UrlAgent = {
callback(null, readStream)
_prependHttpIfNeeded: (url) ->
if !/:///.test(url)
if !url.match('://')
url = 'http://' + url
return url

View file

@ -200,7 +200,7 @@ define [
userAgent &&
/.*Safari\/.*/.test(userAgent) &&
!/.*Chrome\/.*/.test(userAgent) &&
!/.*Chromium\/.*/.test(userAgent) &&
!/.*Chromium\/.*/.test(userAgent)
)
catch err
console.error err