check for None value in utils.safe_header
In case that a sensetive header (that should be obscured by its SHA1 hash) is None, the safe_header throws an exception which fails the calling process and by that may harm the functionality. Change-Id: I56944a382fd546eba0a6dd6d6b1cecf83b1dc106 Closes-Bug: #1491311
This commit is contained in:
@@ -450,7 +450,7 @@ def memoized_property(fn):
|
||||
|
||||
|
||||
def safe_header(name, value):
|
||||
if name in SENSITIVE_HEADERS:
|
||||
if value is not None and name in SENSITIVE_HEADERS:
|
||||
v = value.encode('utf-8')
|
||||
h = hashlib.sha1(v)
|
||||
d = h.hexdigest()
|
||||
|
||||
Reference in New Issue
Block a user