Socket
Socket
Sign inDemoInstall

aws-log-replay

Package Overview
Dependencies
143
Maintainers
59
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.6.1 to 2.7.0-dev7

.nvmrc

42

index.js

@@ -12,2 +12,4 @@ var request = require('requestretry');

const allowedMethods = ['GET', 'HEAD'];
/**

@@ -25,3 +27,3 @@ * decode a path according to cloudfront character encoding spec

else
return match;
return match;
});

@@ -49,8 +51,15 @@ }

}
if (!path) return callback();
if (keepReferer && parts[9] && parts[9] !== '-') {
var referer = parts[9];
}
// get Referer
if (path && referer) generatePath.push([path, referer]);
else generatePath.push(path);
const method = parts[5];
// get Referer & method
if (method && allowedMethods.some((m) => method.includes(m))) {
const obj = { path, method };
if (referer) obj.referer = referer;
generatePath.push(obj);
}
}

@@ -63,4 +72,8 @@ } else if (type.toLowerCase() == 'lb') {

path = url.parse(path).path;
const method = parts.length === 18 ? parts[11] : parts[12];
if (!path) return callback();
generatePath.push(path);
// get request method
// usually it is stored as "GET, regex will help remove the non-alphabetical characters
if (method && allowedMethods.some((m) => method.includes(m))) generatePath.push({ path, method: method.match(/[a-zA-Z]+/g)[0] });
}

@@ -86,9 +99,8 @@ callback();

var pathname, referer;
if (typeof data === 'object') {
pathname = data[0];
referer = data[1];
if (referer && typeof referer !== 'string') referer = referer.toString('utf8');
} else {
pathname = data;
}
const method = data['method'];
referer = data['referer'];
if (referer && typeof referer !== 'string') referer = referer.toString('utf8');
pathname = data['path'];
if (typeof pathname !== 'string') pathname = pathname.toString('utf8');

@@ -109,5 +121,9 @@ if (!pathname || pathname.indexOf('/') !== 0) return callback();

if (referer) {
requestOptions.headers = { referer: referer };
requestOptions.headers = { referer };
}
if (method) {
requestOptions.method = method;
}
request(requestOptions, (err, res, body) => {

@@ -114,0 +130,0 @@ if (err) return callback(err);

@@ -8,3 +8,3 @@ {

"engines": {
"node": ">=8.10.0"
"node": ">=14"
},

@@ -14,3 +14,3 @@ "name": "aws-log-replay",

"author": "Mapbox",
"version": "2.6.1",
"version": "2.7.0-dev7",
"dependencies": {

@@ -33,3 +33,3 @@ "agentkeepalive": "^3.5.1",

"documentation": "2.0.x",
"eslint": "^3.11.1",
"eslint": "^4.19.1",
"request": "^2.87.0",

@@ -36,0 +36,0 @@ "tape": "3.5.x"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc