mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
lets try response headers as dicts
This commit is contained in:
@@ -15,7 +15,7 @@ def convert_to_unicode(resp):
|
||||
|
||||
def convert_headers_to_bytes(resp):
|
||||
try:
|
||||
resp['headers'] = [h.encode('utf-8') for h in resp['headers']]
|
||||
resp['headers'] = dict([(k.encode('utf-8'), [v.encode('utf-8') for v in values]) for k, values in resp['headers'].items()])
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
return resp
|
||||
@@ -23,7 +23,7 @@ def convert_headers_to_bytes(resp):
|
||||
|
||||
def convert_headers_to_unicode(resp):
|
||||
try:
|
||||
resp['headers'] = [h.decode('utf-8') for h in resp['headers']]
|
||||
resp['headers'] = dict([(k.decode('utf-8'), [v.decode('utf-8') for v in values]) for k, values in resp['headers'].items()])
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
return resp
|
||||
|
||||
Reference in New Issue
Block a user