Comparing version 0.11.0 to 0.12.0
@@ -0,1 +1,7 @@ | ||
# 0.12.0 - 8/1/2016 | ||
* Add `environment` config option and `setRelease` method [See #179] | ||
* No longer passes `process.env` values [See #182] | ||
* Connect/Express middleware now attempts to attach `req.user` as User interface [See #177] | ||
* Use json-stringify-safe to prevent circular refs [See #182] | ||
# 0.11.0 - 5/5/2016 | ||
@@ -2,0 +8,0 @@ * `captureError` renamed to `captureException` to match raven-js (alias exists for backwards compat) |
'use strict'; | ||
var stringify = require('json-stringify-safe'); | ||
var parsers = require('./parsers'); | ||
@@ -44,2 +45,3 @@ var zlib = require('zlib'); | ||
this.release = options.release || process.env.SENTRY_RELEASE || ''; | ||
this.environment = options.environment || process.env.SENTRY_ENVIRONMENT || ''; | ||
@@ -104,3 +106,3 @@ this.loggerName = options.logger || ''; | ||
var ident = { | ||
'id': kwargs.event_id | ||
id: kwargs.event_id | ||
}; | ||
@@ -120,13 +122,5 @@ | ||
var self = this; | ||
var skwargs = stringify(kwargs); | ||
// stringify, but don't choke on circular references, see: http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json | ||
var cache = []; | ||
var skwargs = JSON.stringify(kwargs, function(k, v) { | ||
if (typeof v === 'object' && v !== null) { | ||
if (cache.indexOf(v) !== -1) return; | ||
cache.push(v); | ||
} | ||
return v; | ||
}); | ||
zlib.deflate(skwargs, function(err, buff) { | ||
@@ -133,0 +127,0 @@ var message = buff.toString('base64'), |
@@ -5,2 +5,4 @@ 'use strict'; | ||
var urlParser = require('url'); | ||
var stringify = require('json-stringify-safe'); | ||
var utils = require('./utils'); | ||
@@ -142,3 +144,3 @@ | ||
// Make sure the request body is a string | ||
data = JSON.stringify(data); | ||
data = stringify(data); | ||
} | ||
@@ -161,13 +163,32 @@ | ||
data: data, | ||
url: url, | ||
env: process.env | ||
url: url | ||
}; | ||
// add remote ip | ||
http.env.REMOTE_ADDR = ip; | ||
// expose http interface | ||
kwargs.request = http; | ||
// user | ||
// | ||
// typically found on req.user according to Express and Passport | ||
var user = {}; | ||
if (!kwargs.user) { | ||
if (req.user) { | ||
// shallow copy is okay because we are only modifying top-level | ||
// object (req.user) | ||
for (var key in req.user) { | ||
if ({}.hasOwnProperty.call(req.user, key)) { | ||
user[key] = req.user[key]; | ||
} | ||
} | ||
} | ||
if (ip) { | ||
user.ip_address = ip; | ||
} | ||
kwargs.user = user; | ||
} | ||
return kwargs; | ||
}; |
@@ -12,4 +12,4 @@ 'use strict'; | ||
var protocolMap = { | ||
'http': 80, | ||
'https': 443 | ||
http: 80, | ||
https: 443 | ||
}; | ||
@@ -16,0 +16,0 @@ |
@@ -12,6 +12,6 @@ { | ||
], | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"repository": "git://github.com/getsentry/raven-node.git", | ||
"author": "Matt Robenolt <matt@ydekproductions.com>", | ||
"license": "BSD", | ||
"license": "BSD-2-Clause", | ||
"main": "index", | ||
@@ -23,3 +23,3 @@ "bin": { | ||
"pretest": "npm install && npm run lint", | ||
"test": "NODE_ENV=test mocha --reporter dot && NODE_ENV=test node_modules/coffee-script/bin/coffee ./test/run.coffee", | ||
"test": "NODE_ENV=test istanbul cover _mocha -- --reporter dot && NODE_ENV=test node_modules/coffee-script/bin/coffee ./test/run.coffee", | ||
"lint": "node_modules/eslint/bin/eslint.js ." | ||
@@ -32,2 +32,3 @@ }, | ||
"cookie": "0.1.0", | ||
"json-stringify-safe": "^5.0.1", | ||
"lsmod": "1.0.0", | ||
@@ -43,2 +44,3 @@ "node-uuid": "~1.4.1", | ||
"glob": "~3.1.13", | ||
"istanbul": "^0.4.3", | ||
"koa": "*", | ||
@@ -45,0 +47,0 @@ "mocha": "*", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
299187
51
0
1116
5
11
+ Addedjson-stringify-safe@^5.0.1
+ Addedjson-stringify-safe@5.0.1(transitive)