chromedriver
Advanced tools
Comparing version 2.22.0 to 2.22.1
@@ -8,2 +8,3 @@ 'use strict' | ||
var http = require('http') | ||
var https = require('https') | ||
var kew = require('kew') | ||
@@ -107,4 +108,5 @@ var npmconf = require('npmconf') | ||
function getRequestOptions(proxyUrl) { | ||
var options | ||
if (proxyUrl) { | ||
var options = url.parse(proxyUrl) | ||
options = url.parse(proxyUrl) | ||
options.path = downloadUrl | ||
@@ -117,7 +119,34 @@ options.headers = { Host: url.parse(downloadUrl).host } | ||
} | ||
return options | ||
} else { | ||
return url.parse(downloadUrl) | ||
options = url.parse(downloadUrl) | ||
} | ||
// Use certificate authority settings from npm | ||
var ca = process.env.npm_config_ca | ||
if (!ca && process.env.npm_config_cafile) { | ||
try { | ||
ca = fs.readFileSync(process.env.npm_config_cafile, {encoding: 'utf8'}) | ||
.split(/\n(?=-----BEGIN CERTIFICATE-----)/g) | ||
// Comments at the beginning of the file result in the first | ||
// item not containing a certificate - in this case the | ||
// download will fail | ||
if (ca.length > 0 && !/-----BEGIN CERTIFICATE-----/.test(ca[0])) { | ||
ca.shift() | ||
} | ||
} catch (e) { | ||
console.error('Could not read cafile', process.env.npm_config_cafile, e) | ||
} | ||
} | ||
if (ca) { | ||
console.log('Using npmconf ca') | ||
options.agentOptions = { | ||
ca: ca | ||
} | ||
options.ca = ca | ||
} | ||
return options | ||
} | ||
@@ -133,3 +162,4 @@ | ||
var client = http.get(requestOptions, function (response) { | ||
var protocol = requestOptions.protocol === 'https:' ? https : http | ||
var client = protocol.get(requestOptions, function (response) { | ||
var status = response.statusCode | ||
@@ -136,0 +166,0 @@ console.log('Receiving...') |
{ | ||
"name": "chromedriver", | ||
"version": "2.22.0", | ||
"version": "2.22.1", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "chromedriver", |
@@ -122,3 +122,3 @@ #!/usr/bin/env node | ||
} catch (err) { | ||
console.error(`Could not delete folder '${tempInstallPathForVersion}'.`); | ||
console.error(`Could not delete folder '${tempInstallPath}'.`); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17106
324
10
5