securenow 5.10.1 → 5.10.2
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/nuxt-server-plugin.mjs +3 -3
- package/package.json +1 -1
package/nuxt-server-plugin.mjs
CHANGED
|
@@ -46,7 +46,7 @@ const DEFAULT_SENSITIVE_FIELDS = [
|
|
|
46
46
|
function redactSensitiveData(obj, fields = DEFAULT_SENSITIVE_FIELDS) {
|
|
47
47
|
if (!obj || typeof obj !== 'object') return obj;
|
|
48
48
|
const redacted = Array.isArray(obj) ? [...obj] : { ...obj };
|
|
49
|
-
for (const key
|
|
49
|
+
for (const key of Object.keys(redacted)) {
|
|
50
50
|
const lower = key.toLowerCase();
|
|
51
51
|
if (fields.some((f) => lower.includes(f.toLowerCase()))) {
|
|
52
52
|
redacted[key] = '[REDACTED]';
|
|
@@ -133,7 +133,7 @@ export default defineNitroPlugin((nitroApp) => {
|
|
|
133
133
|
opts.captureBody ??
|
|
134
134
|
(String(env('SECURENOW_CAPTURE_BODY')) === '1' ||
|
|
135
135
|
String(env('SECURENOW_CAPTURE_BODY')).toLowerCase() === 'true');
|
|
136
|
-
const maxBodySize = parseInt(env('SECURENOW_MAX_BODY_SIZE') ||
|
|
136
|
+
const maxBodySize = Math.max(1024, parseInt(env('SECURENOW_MAX_BODY_SIZE'), 10) || 10240);
|
|
137
137
|
const customSensitiveFields = (env('SECURENOW_SENSITIVE_FIELDS') || '')
|
|
138
138
|
.split(',')
|
|
139
139
|
.map((s) => s.trim())
|
|
@@ -208,7 +208,7 @@ export default defineNitroPlugin((nitroApp) => {
|
|
|
208
208
|
'http.request.body.size': size,
|
|
209
209
|
});
|
|
210
210
|
} catch {
|
|
211
|
-
span.setAttribute('http.request.body',
|
|
211
|
+
span.setAttribute('http.request.body', '[UNPARSEABLE - REDACTED FOR SAFETY]');
|
|
212
212
|
span.setAttribute('http.request.body.parse_error', true);
|
|
213
213
|
}
|
|
214
214
|
});
|
package/package.json
CHANGED