@firstfleet/fferrorhandler
Advanced tools
+3
-1
@@ -7,2 +7,3 @@ const handlers = require("./handlers"); | ||
| const appName = process.env.PAPERTRAIL_PROGRAM || "UNKNOWN"; | ||
| const IPHEADER = 'x-real-ip' //header passed in from nginx | ||
@@ -113,3 +114,4 @@ /** | ||
| /** If this is an expected error, log to papertrail, with any additional data */ | ||
| handlers.logAndNotify(appName, routeString, error.message, additionalData); | ||
| const ip = req.headers[IPHEADER] ?? req.ip; | ||
| handlers.logAndNotify(appName, routeString, `${error.message} (${ip})`, additionalData); | ||
| } | ||
@@ -116,0 +118,0 @@ |
+1
-1
| { | ||
| "name": "@firstfleet/fferrorhandler", | ||
| "version": "2.1.6", | ||
| "version": "2.1.7", | ||
| "description": "handle errors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,3 +31,5 @@ const middleware = require("../middleware"); | ||
| thing: "two" | ||
| } | ||
| }, | ||
| headers: {}, | ||
| ip: '10.10.10.10' | ||
| }; | ||
@@ -107,3 +109,3 @@ | ||
| `${mockReq.method} - ${mockReq.originalUrl}`, | ||
| operationalError.message, | ||
| `${httpError.message} (${mockReq.ip})`, | ||
| operationalError.data | ||
@@ -122,3 +124,3 @@ ); | ||
| `${mockReq.method} - ${mockReq.originalUrl}`, | ||
| httpError.message, | ||
| `${httpError.message} (${mockReq.ip})`, | ||
| httpError.data | ||
@@ -172,3 +174,3 @@ ); | ||
| `${mockReq.method} - ${mockReq.originalUrl}`, | ||
| httpError.message, | ||
| `${httpError.message} (${mockReq.ip})`, | ||
| parseMockData | ||
@@ -175,0 +177,0 @@ ); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
76595
0.32%1114
0.36%