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:
David Edery
2015-09-02 14:50:47 +03:00
parent 1e2274aef0
commit 75ec9033c2
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -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()