Closed axiomofjoy closed 3 months ago
The argument passed to before_record_response
needs to return a response, otherwise, no cassette will be recorded (not even for the request). So instead of
def callback(response) -> None:
response["headers"].pop("X-Cache", None)
I needed to do
def callback(response) -> None:
response["headers"].pop("X-Cache", None)
return response
I am trying to record a cassette and remove some sensitive response headers. When I use the
before_record_response
parameter, no cassette is recorded.Sorry if this is simple user error. I have not found the answer to the question anywhere.