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) {} } catch (err) {}
}); });
}); });
const gotOpt = {}; const gotOpt = {
if (process.env.npm_config_https_proxy) { agent: caw(null, {
// Use the NPM-configured HTTPS proxy protocol: 'https'
gotOpt.agent = caw(process.env.npm_config_https_proxy); })
} };
const url = distBaseUrl + tarFilename; const url = distBaseUrl + tarFilename;
got.stream(url, gotOpt).on('response', function (response) { got.stream(url, gotOpt).on('response', function (response) {
if (response.statusCode !== 200) { if (response.statusCode !== 200) {

View File

@ -13,6 +13,10 @@ Requires libvips v8.4.2.
* Simplify expression for finding vips-cpp libdir. * Simplify expression for finding vips-cpp libdir.
[#656](https://github.com/lovell/sharp/pull/656) [#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 #### v0.17.0 - 11<sup>th</sup> December 2016
* Drop support for versions of Node prior to v4. * Drop support for versions of Node prior to v4.