mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
Tolerate urllib3.response.HTTPResponse.msg being None
This commit is contained in:
committed by
Kevin McCarthy
parent
64d6811eda
commit
ac20cd1dd3
@@ -47,8 +47,9 @@ def parse_headers(header_list):
|
|||||||
|
|
||||||
|
|
||||||
def serialize_headers(response):
|
def serialize_headers(response):
|
||||||
|
headers = response.headers if response.msg is None else response.msg
|
||||||
out = {}
|
out = {}
|
||||||
for key, values in compat.get_headers(response.msg):
|
for key, values in compat.get_headers(headers):
|
||||||
out.setdefault(key, [])
|
out.setdefault(key, [])
|
||||||
out[key].extend(values)
|
out[key].extend(values)
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user