mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Added a note on the deepcopy
This commit is contained in:
@@ -146,6 +146,8 @@ def decode_response(response):
|
|||||||
else: # encoding == 'deflate'
|
else: # encoding == 'deflate'
|
||||||
return zlib.decompress(body)
|
return zlib.decompress(body)
|
||||||
|
|
||||||
|
# Deepcopy here in case headers contain lists and other objects that could
|
||||||
|
# be mutated by a shallow copy.
|
||||||
response = copy.deepcopy(response)
|
response = copy.deepcopy(response)
|
||||||
headers = CaseInsensitiveDict(response['headers'])
|
headers = CaseInsensitiveDict(response['headers'])
|
||||||
if is_compressed(headers):
|
if is_compressed(headers):
|
||||||
|
|||||||
Reference in New Issue
Block a user