diff --git a/lib/api.js b/lib/api.js index 9aa5dca5..29b675c9 100644 --- a/lib/api.js +++ b/lib/api.js @@ -258,10 +258,18 @@ module.exports = (function() { this.queue.push(function(done) { self.info("Fetching <%s> (as %s)...", url, encoding); - request({ + const options = { url, - encoding: (encoding === 'binary') ? null : encoding - }, function (error, response, body) { + method: 'GET', + proxy: self.proxy || false, + jar: self.jar, + encoding: (encoding === 'binary') ? null : encoding, + headers: { + 'User-Agent': self.userAgent + } + }; + + request(options, function (error, response, body) { if (!error && response.statusCode === 200) { self.info('<%s>: fetched %s kB', url, (body.length/1024).toFixed(2)); callback(null, body);