Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function obtainInfo(action, id, cb) {
request.post({
url: action,
form: {
trackingNo03: id
},
timeout: 20000
}, function (error, response, body) {
if (error || response.statusCode != 200) {
cb(utils.errorDown())
return
}
// Not found
if (body.indexOf('Please insert the correct Tracking Number.') != -1) {
cb(utils.errorNoData())
return
}
"args": config.executor.args,
"env": (config.executor.env || {}),
"inputs": ins.map(i => i),
"outputs": outs.map(o => o),
"options": options,
"stdout": config.executor.stdout,
"logName": logName
};
const url = executor_config.service_url;
console.log("Executing: " + JSON.stringify(jobMessage) + "@" + url);
const fireTime = Date.now();
request.post({
timeout: 600000,
url: url,
json: jobMessage,
retryStrategy: retry,
headers: {'Content-Type': 'application/json', 'Accept': '*/*'}
})
.then(async function (response) {
if (response) {
console.log("Function: " + executable + " response status code: " + response.statusCode + " number of request attempts: " + response.attempts)
}
if (executor_config.S3_metrics) {
await waitForLogs(1)
} else {
console.log("Metrics: task: " + executable + " fire time " + fireTime + " " + response.body);
}
console.log("Lambda task: " + executable + " completed successfully.");
function requestCb(err, response, body) {
if (err) {
console.log("Function: " + executable + " error: " + err);
cb(err, outs);
return
}
if (response) {
console.log("Function: " + executable + " response status code: " + response.statusCode + " number of request attempts: " + response.attempts)
}
console.log("Function: " + executable + " data: " + body.toString());
cb(null, outs);
}
var req = request.post(
{timeout:600000, url:url, json:jobMessage, headers: {'Content-Type' : 'application/json', 'Accept': '*/*'}}, requestCb);
}
return new Promise((resolve, fail) => {
const url = require('url').parse(this.pokeHashUrl);
const _http = url.protocol == 'https' ? https : http;
request.post(this.pokeHashUrl, {
headers: {
"X-AuthToken": this.pokeHashKey,
"content-type": "application/json",
"User-Agent": "node-pogo-signature"
},
body: requestData,
followAllRedirects: true,
gzip: true,
method: "POST",
timeout: 5000,
maxAttempts: 5,
retryDelay: 1,
retryStrategy: retryStrat
}, (err, res, data) => {
if(err){
return fail(err);
function obtainInfo(action, id, cb) {
request.post({
url: action,
form: {
code: id,
lng: 'en',
type: 'update'
},
headers: {
'Referer': 'https://track24.net',
'Origin': 'https://track24.net'
},
timeout: 20000,
maxAttempts: 2,
}, function (error, response, body) {
if (error || response.statusCode != 200) {
cb(utils.errorDown())
return