1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Tolerate urllib3.response.HTTPResponse.msg being None

This commit is contained in:
Sebastian Pipping
2023-05-16 13:42:53 +02:00
committed by Kevin McCarthy
parent 64d6811eda
commit ac20cd1dd3

View File

@@ -47,8 +47,9 @@ def parse_headers(header_list):
def serialize_headers(response):
headers = response.headers if response.msg is None else response.msg
out = {}
for key, values in compat.get_headers(response.msg):
for key, values in compat.get_headers(headers):
out.setdefault(key, [])
out[key].extend(values)
return out