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

scrubFields config doesn't support paths (e.g. request.session.myKey)? #479

Open
drjayvee opened this issue Feb 3, 2020 · 1 comment
Open
Assignees

Comments

@drjayvee
Copy link

drjayvee commented Feb 3, 2020

Surely I must be doing something wrong, but it seems like scrubFields doesn't properly deal with paths (e.g. request.session.myKey).

I'm using v1.8.1 and have checked what happens in Scrubber::scrubArray:114. $fields is the scrubFields array from the configuration literal, which includes paths (e.g. request.session.myKey). $key, on the other hand, is always only the last part (e.g. myKey).

It looks like the code should check isset($fields[strtolower($current)]) as well as isset($fields[strtolower($key)]) maybe?

As an example:

Rollbar::init([
  'scrubFields' => [
    'request.session.myKey'
  ]
]);

Does not scrub myKey, while

Rollbar::init([
  'scrubFields' => [
    'myKey'
  ]
]);

does.

The documentation actually lists a couple of path values in the defaults (e.g. request.session.csrf_), so I fully expect this to work.

@kwolniak
Copy link

kwolniak commented Oct 26, 2020

Bump! Have same problem. For example i want to scrub request.body. Because when I send payload as json string, it is not scrubbed. When i set body or request in scrubFields api calls fails.

@danielmorell danielmorell self-assigned this Dec 20, 2022
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

No branches or pull requests

3 participants