mirror of
https://github.com/lovell/sharp.git
synced 2025-07-11 19:40:14 +02:00
Use the NPM-configured HTTPS proxy, if present
This commit is contained in:
parent
be381e4440
commit
16e0d54b15
@ -77,7 +77,14 @@ module.exports.download_vips = function() {
|
||||
var tmpFile = fs.createWriteStream(tarPath).on('finish', function() {
|
||||
unpack(tarPath);
|
||||
});
|
||||
request(distBaseUrl + tarFilename).on('response', function(response) {
|
||||
var options = {
|
||||
url: distBaseUrl + tarFilename
|
||||
};
|
||||
if (process.env.npm_config_https_proxy) {
|
||||
// Use the NPM-configured HTTPS proxy
|
||||
options.proxy = process.env.npm_config_https_proxy;
|
||||
}
|
||||
request(options).on('response', function(response) {
|
||||
if (response.statusCode !== 200) {
|
||||
error(distBaseUrl + tarFilename + ' status code ' + response.statusCode);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user