Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper scrubbing #510

Merged
merged 3 commits into from
Nov 29, 2017
Merged

Proper scrubbing #510

merged 3 commits into from
Nov 29, 2017

Conversation

rokob
Copy link
Contributor

@rokob rokob commented Nov 20, 2017

Fixes #508
Fixes #509

We should not modify an object in-place to scrub it.
We should not use an unanchored regular expression for testing whether to scrub a key.

for (i = 0; i < keys.length; ++i) {
k = keys[i];
v = obj[k];
obj[k] = func(k, v, seen);
result[k] = func(k, v, seen);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like clearly the right thing to do, but just to ask... are there any places that we currently use traverse where we actually do/might want to modify in-place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only used internally by the scrubbing method

@rokob rokob merged commit 947182f into master Nov 29, 2017
bobzoller added a commit to goodeggs/rollbar-stream that referenced this pull request Dec 12, 2017
fixes a pretty bad mutation bug: rollbar/rollbar.js#510
@rokob rokob deleted the proper-scrubbing branch February 1, 2018 23:02
mudetroit pushed a commit that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants