Skip to content
Merged
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
8 changes: 4 additions & 4 deletions sentry_sdk/integrations/redis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ def _get_safe_command(name, args):
# type: (str, Sequence[Any]) -> str
command_parts = [name]

name_low = name.lower()
send_default_pii = should_send_default_pii()

for i, arg in enumerate(args):
if i > _MAX_NUM_ARGS:
break

name_low = name.lower()

if name_low in _COMMANDS_INCLUDING_SENSITIVE_DATA:
command_parts.append(SENSITIVE_DATA_SUBSTITUTE)
continue

arg_is_the_key = i == 0
if arg_is_the_key:
command_parts.append(repr(arg))

else:
if should_send_default_pii():
if send_default_pii:
command_parts.append(repr(arg))
else:
command_parts.append(SENSITIVE_DATA_SUBSTITUTE)
Expand Down