|
|
@ -170,10 +170,13 @@ function request(url, callback) {
|
|
|
|
require('request')(url, {
|
|
|
|
require('request')(url, {
|
|
|
|
json: true,
|
|
|
|
json: true,
|
|
|
|
}, function (err, res, body) {
|
|
|
|
}, function (err, res, body) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
return callback(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (res.statusCode === 404 || !body) {
|
|
|
|
if (res.statusCode === 404 || !body) {
|
|
|
|
return callback(err, {});
|
|
|
|
return callback(null, {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
callback(err, body);
|
|
|
|
callback(null, body);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const requestAsync = util.promisify(request);
|
|
|
|
const requestAsync = util.promisify(request);
|
|
|
|