Skip to content

Instantly share code, notes, and snippets.

@clayg
Created February 26, 2016 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/8be5b7309f631ba59a32 to your computer and use it in GitHub Desktop.
Save clayg/8be5b7309f631ba59a32 to your computer and use it in GitHub Desktop.
diff --git a/swiftclient/client.py b/swiftclient/client.py
index 8375fed..7b54bc0 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -110,7 +110,7 @@ def safe_value(name, value):
prefix_length = int(
min(prefix_length, (len(value) ** 2) / 32, len(value) / 2)
)
- redacted_value = value[0:prefix_length]
+ redacted_value = parse_header_string(value)[0:prefix_length]
return redacted_value + '...'
return value
@@ -126,7 +126,7 @@ def scrub_headers(headers):
if isinstance(headers, dict):
headers = headers.items()
headers = [
- (parse_header_string(key), parse_header_string(val))
+ (parse_header_string(key), val)
for (key, val) in headers
]
if not logger_settings.get('redact_sensitive_headers', True):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment