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

Don't write header values multiple times.

On Python 3, response.msg.keys() contains the same value multiple times if
there are multiple headers with the same value.  Work around this by
converting to a set before iterating over it.
This commit is contained in:
Matt Thomson
2014-09-06 16:57:12 +01:00
parent 7a5795a547
commit 3c410b5f9d
2 changed files with 12 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ def get_header_items(message):
def get_headers(response):
for key in response.msg.keys():
for key in set(response.msg.keys()):
if six.PY3:
yield key, response.msg.get_all(key)
else: