Skip to content

Commit e002e4f

Browse files
committed
3.24.0
1 parent cf87968 commit e002e4f

22 files changed

+208
-38
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.24.0
4+
5+
* NEW: Introduce `sanitizeKeys` config option (#1264)
6+
* NEW: Expose Ravens constructor publicly. Kinda. (#1272)
7+
* BUGFIX: Guard for invalid input to `fill` helper method (#1265)
8+
* BUGFIX: Check if `XMLHttpRequest` exists before using it (#1265)
9+
310
## 3.23.3
411

512
* BUGFIX: Fix detection of custom error objects in `captureException` method, aka "Schrodinger's Error"© patch(#1261)

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.23.3",
3+
"version": "3.24.0",
44
"dependencies": {},
55
"main": "dist/raven.js",
66
"ignore": [

dist/plugins/angular.js

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.23.3 (f261ec2) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.24.0 (cf87968) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -502,6 +502,7 @@ function isSameStacktrace(stack1, stack2) {
502502
* @param track {optional} record instrumentation to an array
503503
*/
504504
function fill(obj, name, replacement, track) {
505+
if (obj == null) return;
505506
var orig = obj[name];
506507
obj[name] = replacement(orig);
507508
obj[name].__raven__ = true;
@@ -625,6 +626,44 @@ function serializeKeysForMessage(keys, maxLength) {
625626
return '';
626627
}
627628

629+
function sanitize(input, sanitizeKeys) {
630+
if (!isArray(sanitizeKeys) || (isArray(sanitizeKeys) && sanitizeKeys.length === 0))
631+
return input;
632+
633+
var sanitizeRegExp = joinRegExp(sanitizeKeys);
634+
var sanitizeMask = '********';
635+
var safeInput;
636+
637+
try {
638+
safeInput = JSON.parse(stringify(input));
639+
} catch (o_O) {
640+
return input;
641+
}
642+
643+
function sanitizeWorker(workerInput) {
644+
if (isArray(workerInput)) {
645+
return workerInput.map(function(val) {
646+
return sanitizeWorker(val);
647+
});
648+
}
649+
650+
if (isPlainObject(workerInput)) {
651+
return Object.keys(workerInput).reduce(function(acc, k) {
652+
if (sanitizeRegExp.test(k)) {
653+
acc[k] = sanitizeMask;
654+
} else {
655+
acc[k] = sanitizeWorker(workerInput[k]);
656+
}
657+
return acc;
658+
}, {});
659+
}
660+
661+
return workerInput;
662+
}
663+
664+
return sanitizeWorker(safeInput);
665+
}
666+
628667
module.exports = {
629668
isObject: isObject,
630669
isError: isError,
@@ -656,7 +695,8 @@ module.exports = {
656695
fill: fill,
657696
safeJoin: safeJoin,
658697
serializeException: serializeException,
659-
serializeKeysForMessage: serializeKeysForMessage
698+
serializeKeysForMessage: serializeKeysForMessage,
699+
sanitize: sanitize
660700
};
661701

662702
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

dist/plugins/angular.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)