Allow HTTP-over-HTTPS proxy when d/l pre-compiled deps #679

This commit is contained in:
Lovell Fuller 2017-01-14 11:22:50 +00:00
parent 473055468a
commit 86b4816b3f
2 changed files with 9 additions and 5 deletions

View File

@ -98,11 +98,11 @@ module.exports.download_vips = function () {
} catch (err) {}
});
});
const gotOpt = {};
if (process.env.npm_config_https_proxy) {
// Use the NPM-configured HTTPS proxy
gotOpt.agent = caw(process.env.npm_config_https_proxy);
}
const gotOpt = {
agent: caw(null, {
protocol: 'https'
})
};
const url = distBaseUrl + tarFilename;
got.stream(url, gotOpt).on('response', function (response) {
if (response.statusCode !== 200) {

View File

@ -13,6 +13,10 @@ Requires libvips v8.4.2.
* Simplify expression for finding vips-cpp libdir.
[#656](https://github.com/lovell/sharp/pull/656)
* Allow HTTP-over-HTTPS proxy when downloading pre-compiled dependencies.
[@wangzhiwei1888](https://github.com/wangzhiwei1888)
[#679](https://github.com/lovell/sharp/issues/679)
#### v0.17.0 - 11<sup>th</sup> December 2016
* Drop support for versions of Node prior to v4.