Closed Lukas0907 closed 6 years ago
I debugged this a bit and I think I found the problem.
def replace_in_headers(self, text_to_replace, placeholder):
for obj in ('request', 'response'):
headers = self.data[obj]['headers']
for k, v in list(headers.items()):
v = util.from_list(v)
headers[k] = v.replace(text_to_replace, placeholder)
(from cassette/interaction.py)
v = util.from_list(v)
returns the first element of the list (if it is a list), or the element itself. This way, we lose all elements in the list except the first one.
Well done, @Lukas0907! Would you like to send a PR?
Thanks! :) Yes, I'm currently testing a fix locally and will send a PR soon.
I've created a PR #129 which works for me and also added this scenario to existing tests.
Fixed in #129.
Hi,
the following code produces a cassette that does not contain a list for every header in the recorded cassette:
The cassette:
The result is that
Set-Cookie
is only included once, i.e. the first cookie is lost. If I remove the cassette placeholder, the cassette looks different:Cheers,
Lukas