Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (N, params) {
let rootUrl = _.get(N.config, 'bind.default.mount', 'http://localhost') + '/';
let userAgent = `${probe_pkg.name}/${probe_pkg.version} (Nodeca; +${rootUrl})`;
let request = _request.defaults({
timeout: 120000,
headers: { 'User-Agent': userAgent },
agentOptions: {
keepAlive: true,
keepAliveMsecs: 15000,
maxFreeSockets: 512
}
});
function get_size(url) {
return new Promise((resolve, reject) => {
let req;
try {
module.exports = function (N) {
let rootUrl = _.get(N.config, 'bind.default.mount', 'http://localhost') + '/';
let userAgent = `${probe_pkg.name}/${probe_pkg.version} (Nodeca; +${rootUrl})`;
let request = _request.defaults({
timeout: 120000,
headers: { 'User-Agent': userAgent },
agentOptions: {
keepAlive: true,
keepAliveMsecs: 15000,
maxFreeSockets: 512
}
});
function get_size(url) {
return new Promise((resolve, reject) => {
let req;
try {