Skip to content

Commit

Permalink
fix(httpx): don't save response if filtered to None
Browse files Browse the repository at this point in the history
  • Loading branch information
alekseik1 committed Jan 27, 2025
1 parent 8197865 commit d763372
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vcr/stubs/httpx_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ async def _record_responses(cassette, vcr_request, real_response, aread):
# final redirect value
vcr_request = _make_vcr_request(real_response.request)

cassette.append(vcr_request, await _to_serialized_response(real_response, aread))
should_save_response = cassette._before_record_request(vcr_request) is not None
if should_save_response:
cassette.append(vcr_request, await _to_serialized_response(real_response, aread))
return real_response


Expand Down

0 comments on commit d763372

Please sign in to comment.