@jaypie/express 1.2.14 → 1.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.cjs
CHANGED
|
@@ -1512,6 +1512,11 @@ const decorateResponse = (res, { handler = "", version = process.env.PROJECT_VER
|
|
|
1512
1512
|
// about the environment's secret parameters, the special adapter,
|
|
1513
1513
|
// HTTP, etc. There must be a better way to organize this
|
|
1514
1514
|
|
|
1515
|
+
//
|
|
1516
|
+
//
|
|
1517
|
+
// Constants
|
|
1518
|
+
//
|
|
1519
|
+
const SENSITIVE_HEADERS = new Set(["authorization", "cookie", "set-cookie"]);
|
|
1515
1520
|
//
|
|
1516
1521
|
//
|
|
1517
1522
|
// Function Definition
|
|
@@ -1522,10 +1527,19 @@ function summarizeRequest(req) {
|
|
|
1522
1527
|
if (Buffer.isBuffer(body)) {
|
|
1523
1528
|
body = body.toString();
|
|
1524
1529
|
}
|
|
1530
|
+
// Redact sensitive headers
|
|
1531
|
+
const headers = {
|
|
1532
|
+
...req.headers,
|
|
1533
|
+
};
|
|
1534
|
+
for (const key of Object.keys(headers)) {
|
|
1535
|
+
if (SENSITIVE_HEADERS.has(key.toLowerCase())) {
|
|
1536
|
+
headers[key] = logger$2.redactAuth(headers[key]);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1525
1539
|
return {
|
|
1526
1540
|
baseUrl: req.baseUrl,
|
|
1527
1541
|
body,
|
|
1528
|
-
headers
|
|
1542
|
+
headers,
|
|
1529
1543
|
method: req.method,
|
|
1530
1544
|
query: req.query,
|
|
1531
1545
|
url: req.url,
|