Skip to content

Commit

Permalink
Using http or https accordingly
Browse files Browse the repository at this point in the history
Fixes #78

Signed-off-by: Giovanni Bassi <giggio@giggio.net>
  • Loading branch information
giggio committed Dec 11, 2016
1 parent e79ac33 commit 5ad68a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ npmconf.load(function(err, conf) {
promise = promise.then(function () {
console.log('Downloading', downloadUrl)
console.log('Saving to', downloadedFile)
return requestBinary(getRequestOptions(conf.get('proxy')), downloadedFile)
return requestBinary(getRequestOptions(conf), downloadedFile)
})

promise.then(function () {
Expand Down Expand Up @@ -108,8 +108,9 @@ function findSuitableTempDirectory(npmConf) {
}


function getRequestOptions(proxyUrl) {
var options
function getRequestOptions(conf) {
var options = url.parse(downloadUrl);
var proxyUrl = options.protocol === 'https:' ? conf.get('https-proxy') : conf.get('proxy');
if (proxyUrl) {
options = url.parse(proxyUrl)
options.path = downloadUrl
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chromedriver",
"version": "2.25.2",
"version": "2.25.3",
"keywords": [
"chromedriver",
"selenium"
Expand Down

0 comments on commit 5ad68a3

Please sign in to comment.