selenium-standalone
Advanced tools
Comparing version 2.42.0-2.9.0 to 2.42.0-2.9.0-1
@@ -70,5 +70,5 @@ var conf = require('./conf.js'); | ||
var dl = util.format(chromedriverUrl, version, platform); | ||
var downloadUrl = util.format(chromedriverUrl, version, platform); | ||
getDownloadStream(dl, function(err, stream) { | ||
getDownloadStream(downloadUrl, function(err, stream) { | ||
if (err) { | ||
@@ -80,3 +80,3 @@ return cb(err); | ||
console.log('Unzipping ' + dl); | ||
console.log('Unzipping ' + downloadUrl); | ||
@@ -91,11 +91,27 @@ stream | ||
}) | ||
.once('error', cb.bind(null, new Error('Could not unzip ' + dl))) | ||
.once('error', cb.bind(null, new Error('Could not unzip ' + downloadUrl))) | ||
}) | ||
} | ||
function getDownloadStream(dl, cb) { | ||
function getDownloadStream(downloadUrl, cb) { | ||
var proxy = process.env.HTTP_PROXY || process.env.http_proxy; | ||
var requestOpts = downloadUrl; | ||
if (proxy) { | ||
var regexp = /(https?:\/\/)?([^:/]*)/; | ||
requestOpts = { | ||
host: proxy.match(regexp)[2], | ||
port: proxy.match(/:(\d+)/)[1] || 8080, | ||
path: downloadUrl, | ||
headers: { | ||
Host: downloadUrl.match(regexp)[2] | ||
} | ||
}; | ||
} | ||
var r = | ||
require('http') | ||
.request(dl, function(res) { | ||
console.log('Downloading ' + dl, res.statusCode); | ||
.request(requestOpts, function(res) { | ||
console.log('Downloading ' + downloadUrl, res.statusCode); | ||
@@ -108,3 +124,3 @@ if (res.statusCode === 302 && res.headers.location) { | ||
if (res.statusCode !== 200) { | ||
return cb(new Error('Could not download ' + dl)); | ||
return cb(new Error('Could not download ' + downloadUrl)); | ||
} | ||
@@ -114,3 +130,3 @@ | ||
}) | ||
.once('error', cb.bind(null, new Error('Could not download ' + dl))) | ||
.once('error', cb.bind(null, new Error('Could not download ' + downloadUrl))) | ||
@@ -117,0 +133,0 @@ // initiate request |
{ | ||
"name": "selenium-standalone", | ||
"version": "2.42.0-2.9.0", | ||
"version": "2.42.0-2.9.0-1", | ||
"description": "installs a `start-selenium` command line to start a standalone selenium server with chrome-driver", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
10097
184
5