1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Do not redirect on 304 for aiohttp

This commit is contained in:
Jean-Sebastien Roy
2020-01-13 13:55:41 -05:00
parent accffa8ea2
commit 6e040030b8
2 changed files with 20 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ def play_responses(cassette, vcr_request):
# If we're following redirects, continue playing until we reach
# our final destination.
while 300 <= response.status <= 399:
if "location" not in response.headers:
break
next_url = URL(response.url).with_path(response.headers["location"])
# Make a stub VCR request that we can then use to look up the recorded