@ami-app/adonis-http-logger
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@ami-app/adonis-http-logger", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Http request logger for AdonisJs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,3 +13,3 @@ "use strict"; | ||
const prettyMs = require("pretty-ms"); | ||
const onFinished = require("on-finished"); | ||
const onFinished = require("on-finished"); | ||
@@ -24,2 +24,13 @@ const isJSONResponse = (responseHeaders) => { | ||
const censorSensitiveData = (data) => { | ||
if (!data) { | ||
return data; | ||
} | ||
const censoredData = Object.assign({}, data); | ||
if (data.password) { | ||
censoredData.password = "[PRIVATE]"; | ||
} | ||
return censoredData; | ||
} | ||
const HOST_WHITELIST = [ | ||
@@ -134,3 +145,3 @@ // TODO: block SSRF attacks | ||
request_headers: JSON.stringify(requestHeaders), | ||
request_body: JSON.stringify(this.request.body), | ||
request_body: JSON.stringify(censorSensitiveData(this.request.body)), | ||
response_headers: JSON.stringify(responseHeaders), | ||
@@ -137,0 +148,0 @@ response_body: isJSONResponse(responseHeaders) ? body : "-", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8240
195