Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sentry_sdk/scrubber.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(
self.denylist += pii_denylist

self.denylist = [x.lower() for x in self.denylist]
self._denylist_set = set(self.denylist)
self.recursive = recursive

def scrub_list(self, lst):
Expand Down Expand Up @@ -111,7 +112,7 @@ def scrub_dict(self, d):
for k, v in d.items():
# The cast is needed because mypy is not smart enough to figure out that k must be a
# string after the isinstance check.
if isinstance(k, str) and k.lower() in self.denylist:
if isinstance(k, str) and k.lower() in self._denylist_set:
d[k] = AnnotatedValue.substituted_because_contains_sensitive_data()
elif self.recursive:
self.scrub_dict(v) # no-op unless v is a dict
Expand Down