Skip to content

Commit

Permalink
3.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Mar 23, 2018
1 parent cf87968 commit e002e4f
Show file tree
Hide file tree
Showing 22 changed files with 208 additions and 38 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 3.24.0

* NEW: Introduce `sanitizeKeys` config option (#1264)
* NEW: Expose Ravens constructor publicly. Kinda. (#1272)
* BUGFIX: Guard for invalid input to `fill` helper method (#1265)
* BUGFIX: Check if `XMLHttpRequest` exists before using it (#1265)

## 3.23.3

* BUGFIX: Fix detection of custom error objects in `captureException` method, aka "Schrodinger's Error"© patch(#1261)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.23.3",
"version": "3.24.0",
"dependencies": {},
"main": "dist/raven.js",
"ignore": [
Expand Down
44 changes: 42 additions & 2 deletions dist/plugins/angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.23.3 (f261ec2) | github.com/getsentry/raven-js */
/*! Raven.js 3.24.0 (cf87968) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down Expand Up @@ -502,6 +502,7 @@ function isSameStacktrace(stack1, stack2) {
* @param track {optional} record instrumentation to an array
*/
function fill(obj, name, replacement, track) {
if (obj == null) return;
var orig = obj[name];
obj[name] = replacement(orig);
obj[name].__raven__ = true;
Expand Down Expand Up @@ -625,6 +626,44 @@ function serializeKeysForMessage(keys, maxLength) {
return '';
}

function sanitize(input, sanitizeKeys) {
if (!isArray(sanitizeKeys) || (isArray(sanitizeKeys) && sanitizeKeys.length === 0))
return input;

var sanitizeRegExp = joinRegExp(sanitizeKeys);
var sanitizeMask = '********';
var safeInput;

try {
safeInput = JSON.parse(stringify(input));
} catch (o_O) {
return input;
}

function sanitizeWorker(workerInput) {
if (isArray(workerInput)) {
return workerInput.map(function(val) {
return sanitizeWorker(val);
});
}

if (isPlainObject(workerInput)) {
return Object.keys(workerInput).reduce(function(acc, k) {
if (sanitizeRegExp.test(k)) {
acc[k] = sanitizeMask;
} else {
acc[k] = sanitizeWorker(workerInput[k]);
}
return acc;
}, {});
}

return workerInput;
}

return sanitizeWorker(safeInput);
}

module.exports = {
isObject: isObject,
isError: isError,
Expand Down Expand Up @@ -656,7 +695,8 @@ module.exports = {
fill: fill,
safeJoin: safeJoin,
serializeException: serializeException,
serializeKeysForMessage: serializeKeysForMessage
serializeKeysForMessage: serializeKeysForMessage,
sanitize: sanitize
};

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Expand Down
4 changes: 2 additions & 2 deletions dist/plugins/angular.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e002e4f

Please sign in to comment.