1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

url-rewrite cookie store: decode() only if redis returns byte strings in py3

This commit is contained in:
Ilya Kreymer 2017-01-25 23:59:57 -08:00
parent 2cc6f5b4d6
commit bb64d0de54

View File

@ -42,8 +42,10 @@ class CookieTracker(object):
continue
for n, v in six.iteritems(res):
n = n.decode('utf-8')
v = v.decode('utf-8')
if six.PY3 and type(n) == six.binary_type:
n = n.decode('utf-8')
v = v.decode('utf-8')
full = n + '=' + v
cookies.append(full.split(';')[0])