Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elastic-apm-node

Package Overview
Dependencies
Maintainers
2
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastic-apm-node - npm Package Compare versions

Comparing version 1.10.2 to 1.11.0

4

CHANGELOG.md

@@ -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 @@

15

lib/instrumentation/modules/express.js

@@ -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
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc