elastic-apm-node
Advanced tools
Comparing version 1.10.2 to 1.11.0
@@ -0,1 +1,5 @@ | ||
# 1.11.0 - 2018/8/15 | ||
* feat(filters): filter set-cookie headers ([485](https://github.com/elastic/apm-agent-nodejs/pull/485)) | ||
* fix(express): cannot create property symbol ([510](https://github.com/elastic/apm-agent-nodejs/pull/510)) | ||
# 1.10.2 - 2018/8/8 | ||
@@ -2,0 +6,0 @@ * fix: ensure logger config can update ([503](https://github.com/elastic/apm-agent-nodejs/pull/503)) |
@@ -5,2 +5,3 @@ 'use strict' | ||
var redact = require('redact-secrets')('[REDACTED]') | ||
var SetCookie = require('set-cookie-serde') | ||
@@ -36,2 +37,8 @@ var REDACTED = '[REDACTED]' | ||
function stringify (value) { | ||
return Array.isArray(value) | ||
? value.map(value => value.toString()) | ||
: value.toString() | ||
} | ||
function httpHeaders (payload) { | ||
@@ -56,2 +63,13 @@ var arr = payload.transactions || payload.errors | ||
} | ||
if (typeof headers['set-cookie'] !== 'undefined') { | ||
try { | ||
var setCookies = new SetCookie(headers['set-cookie']) | ||
redact.forEach(setCookies) | ||
headers['set-cookie'] = stringify(setCookies) | ||
} catch (err) { | ||
// Ignore error | ||
headers['set-cookie'] = '[malformed set-cookie header]' | ||
} | ||
} | ||
}) | ||
@@ -58,0 +76,0 @@ |
@@ -28,2 +28,12 @@ 'use strict' | ||
var reportedSymbol = Symbol('reported') | ||
function shouldReport (err) { | ||
if (typeof err === 'string') return true | ||
if (isError(err) && !err[reportedSymbol]) { | ||
err[reportedSymbol] = true | ||
return true | ||
} | ||
return false | ||
} | ||
function patchLayer (layer) { | ||
@@ -34,6 +44,5 @@ if (!layer[layerPatchedSymbol]) { | ||
shimmer.wrap(layer, 'handle', function (orig) { | ||
if (orig.length !== 4) return orig | ||
if (!agent._conf.captureExceptions || orig.length !== 4) return orig | ||
return function (err, req, res, next) { | ||
if ((isError(err) || typeof err === 'string') && !err[reportedSymbol]) { | ||
err[reportedSymbol] = true | ||
if (shouldReport(err)) { | ||
agent.captureError(err, { request: req }) | ||
@@ -40,0 +49,0 @@ } |
{ | ||
"name": "elastic-apm-node", | ||
"version": "1.10.2", | ||
"version": "1.11.0", | ||
"description": "The official Elastic APM agent for Node.js", | ||
@@ -87,2 +87,3 @@ "main": "index.js", | ||
"semver": "^5.5.0", | ||
"set-cookie-serde": "^1.0.0", | ||
"sql-summary": "^1.0.1", | ||
@@ -157,5 +158,5 @@ "stackman": "^3.0.2", | ||
"coordinates": [ | ||
55.6809248, | ||
12.5643926 | ||
55.6809362, | ||
12.5643515 | ||
] | ||
} |
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
176305
4271
22
+ Addedset-cookie-serde@^1.0.0
+ Addedset-cookie-serde@1.0.0(transitive)