Comparing version 1.1.1 to 1.1.2
@@ -1,2 +0,2 @@ | ||
var Configuration, Logger, Notification, Utils, path; | ||
var Configuration, Logger, Notification, Utils, path, requestInfo; | ||
@@ -9,2 +9,4 @@ Utils = require("./utils"); | ||
requestInfo = require("./request_info"); | ||
path = require("path"); | ||
@@ -22,3 +24,3 @@ | ||
function Notification(bugsnagError, options) { | ||
var domainOptions, event, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9; | ||
var domainOptions, event, _ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9; | ||
if (options == null) { | ||
@@ -51,7 +53,9 @@ options = {}; | ||
} | ||
if (options.req || (typeof process !== "undefined" && process !== null ? (_ref12 = process.domain) != null ? (_ref13 = _ref12._bugsnagOptions) != null ? _ref13.req : void 0 : void 0 : void 0)) { | ||
this.processRequest(event, options.req || (typeof process !== "undefined" && process !== null ? (_ref14 = process.domain) != null ? (_ref15 = _ref14._bugsnagOptions) != null ? _ref15.req : void 0 : void 0 : void 0)); | ||
if (options.req) { | ||
this.processRequest(event, requestInfo(options.req)); | ||
delete options.req; | ||
} else if (typeof process !== "undefined" && process !== null ? (_ref12 = process.domain) != null ? (_ref13 = _ref12._bugsnagOptions) != null ? _ref13.cleanedRequest : void 0 : void 0 : void 0) { | ||
this.processRequest(event, process.domain._bugsnagOptions.cleanedRequest); | ||
} | ||
if (typeof process !== "undefined" && process !== null ? (_ref16 = process.domain) != null ? _ref16._bugsnagOptions : void 0 : void 0) { | ||
if (typeof process !== "undefined" && process !== null ? (_ref14 = process.domain) != null ? _ref14._bugsnagOptions : void 0 : void 0) { | ||
domainOptions = Utils.cloneObject(process.domain._bugsnagOptions, { | ||
@@ -135,34 +139,8 @@ except: ["req", "context", "userId", "groupingHash"] | ||
Notification.prototype.processRequest = function(event, req) { | ||
var full_url, port, portNumber, _ref, _ref1, _ref10, _ref11, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9; | ||
Notification.prototype.processRequest = function(event, cleanRequest) { | ||
var _ref, _ref1; | ||
event.metaData || (event.metaData = {}); | ||
portNumber = (_ref = req.connection) != null ? (_ref1 = _ref.address()) != null ? _ref1.port : void 0 : void 0; | ||
port = !(portNumber != null) || portNumber === 80 || portNumber === 443 ? '' : ':' + portNumber; | ||
full_url = req.protocol + '://' + req.host + port + req.url; | ||
event.metaData.request = { | ||
url: full_url, | ||
method: req.method, | ||
headers: req.headers, | ||
httpVersion: req.httpVersion, | ||
connection: { | ||
remoteAddress: (_ref2 = req.connection) != null ? _ref2.remoteAddress : void 0, | ||
remotePort: (_ref3 = req.connection) != null ? _ref3.remotePort : void 0, | ||
bytesRead: (_ref4 = req.connection) != null ? _ref4.bytesRead : void 0, | ||
bytesWritten: (_ref5 = req.connection) != null ? _ref5.bytesWritten : void 0, | ||
localPort: portNumber, | ||
localAddress: (_ref6 = req.connection) != null ? (_ref7 = _ref6.address()) != null ? _ref7.address : void 0 : void 0, | ||
IPVersion: (_ref8 = req.connection) != null ? (_ref9 = _ref8.address()) != null ? _ref9.family : void 0 : void 0 | ||
} | ||
}; | ||
if (req.params && Object.keys(req.params).length > 0) { | ||
event.metaData.request.params = req.params; | ||
} | ||
if (req.query && Object.keys(req.query).length > 0) { | ||
event.metaData.request.query = req.query; | ||
} | ||
if (req.body && Object.keys(req.body).length > 0) { | ||
event.metaData.request.body = req.body; | ||
} | ||
event.context || (event.context = req.path || req.url); | ||
return event.userId || (event.userId = (req != null ? (_ref10 = req.headers) != null ? _ref10["x-forwarded-for"] : void 0 : void 0) || ((_ref11 = req.connection) != null ? _ref11.remoteAddress : void 0)); | ||
event.metaData.request = cleanRequest; | ||
event.context || (event.context = cleanRequest.path || cleanRequest.url); | ||
return event.userId || (event.userId = (cleanRequest != null ? (_ref = cleanRequest.headers) != null ? _ref["x-forwarded-for"] : void 0 : void 0) || (cleanRequest != null ? (_ref1 = cleanRequest.connection) != null ? _ref1.remoteAddress : void 0 : void 0)); | ||
}; | ||
@@ -169,0 +147,0 @@ |
{ | ||
"name": "bugsnag", | ||
"description": "Bugsnag notifier for node.js scripts", | ||
"version": "1.1.1", | ||
"main": "./lib/bugsnag.js", | ||
"homepage": "http://bugsnag.com", | ||
"dependencies": { | ||
"stack-trace": ">=0.0.6" | ||
}, | ||
"devDependencies" : { | ||
"mocha": "~1.8.0", | ||
"chai": "~1.5.0", | ||
"coffee-script": "latest", | ||
"sinon": "latest", | ||
"grunt": "~0.4.0", | ||
"grunt-contrib-coffee": "~0.4.0", | ||
"grunt-mocha-test": "latest", | ||
"grunt-bumpx": "~0.1.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:bugsnag/bugsnag-node.git" | ||
}, | ||
"keywords": [ | ||
"error", | ||
"bugsnag", | ||
"exception" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"engine": { | ||
"node": ">=0.8" | ||
} | ||
} | ||
"name": "bugsnag", | ||
"description": "Bugsnag notifier for node.js scripts", | ||
"version": "1.1.2", | ||
"main": "./lib/bugsnag.js", | ||
"homepage": "http://bugsnag.com", | ||
"dependencies": { | ||
"stack-trace": ">=0.0.6" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.8.0", | ||
"chai": "~1.5.0", | ||
"coffee-script": "latest", | ||
"sinon": "latest", | ||
"grunt": "~0.4.0", | ||
"grunt-contrib-coffee": "~0.4.0", | ||
"grunt-mocha-test": "latest", | ||
"grunt-bumpx": "~0.1.0", | ||
"express": "~3.4.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:bugsnag/bugsnag-node.git" | ||
}, | ||
"keywords": [ | ||
"error", | ||
"bugsnag", | ||
"exception" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"engine": { | ||
"node": ">=0.8" | ||
} | ||
} |
@@ -290,6 +290,24 @@ Bugsnag Notifier for Node.js | ||
Releasing | ||
--------- | ||
Ensure all the coffee-script is compiled, and the tests pass: | ||
grunt | ||
Bump the version number | ||
grunt bump | ||
Push tag to github | ||
grunt release | ||
Push code to npm | ||
npm publish | ||
License | ||
------- | ||
The Bugsnag Node.js notifier is free software released under the MIT License. See [LICENSE.txt](https://github.com/bugsnag/bugsnag-node/blob/master/LICENSE.txt) for details. | ||
The Bugsnag Node.js notifier is free software released under the MIT License. See [LICENSE.txt](https://github.com/bugsnag/bugsnag-node/blob/master/LICENSE.txt) for details. |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
70017
25
563
313
9
3