diff --git a/lib/pull-request.js b/lib/pull-request.js index 8a57996..9206774 100644 --- a/lib/pull-request.js +++ b/lib/pull-request.js @@ -70,8 +70,13 @@ PullRequest.prototype.setExport = function (callback) { } PullRequest.prototype.getDiff = function (callback) { + var req = {}; + req.url = this.data.diff_url; + if (process.env.http_proxy) { + req.proxy = process.env.http_proxy; + } - request(this.data.diff_url, function (err, res, body) { + request(req, function (err, res, body) { if (err) return callback(err); this.exports.diff = body; callback(null, body); diff --git a/lib/util/github.js b/lib/util/github.js index 9b20c52..ec21d16 100644 --- a/lib/util/github.js +++ b/lib/util/github.js @@ -41,6 +41,9 @@ var github = function (path, options, callback) { else req.body = JSON.stringify(options); } + if (process.env.http_proxy) { + req.proxy = process.env.http_proxy; + } req.url = 'https://api.github.com' + path; req.json = true; req.method = method;