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

Move deepcopy higher to not mutate original headers

This commit is contained in:
Nick DiRienzo
2016-06-20 16:57:40 -07:00
parent 1ef099a13e
commit b5c27f99d1

View File

@@ -146,9 +146,9 @@ def decode_response(response):
else: # encoding == 'deflate'
return zlib.decompress(body)
response = copy.deepcopy(response)
headers = CaseInsensitiveDict(response['headers'])
if is_compressed(headers):
response = copy.deepcopy(response)
encoding = headers['content-encoding'][0]
headers['content-encoding'].remove(encoding)
if not headers['content-encoding']: