From e868b649220a3a430ebbd973cab145acc46d2ff1 Mon Sep 17 00:00:00 2001 From: Paulo Romeira Date: Wed, 17 Jun 2020 19:03:09 -0300 Subject: [PATCH] aiohttp: Fix next_url redirect for absolute paths --- vcr/stubs/aiohttp_stubs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcr/stubs/aiohttp_stubs.py b/vcr/stubs/aiohttp_stubs.py index 652ab0f..a2a76c1 100644 --- a/vcr/stubs/aiohttp_stubs.py +++ b/vcr/stubs/aiohttp_stubs.py @@ -121,7 +121,7 @@ def play_responses(cassette, vcr_request): if "location" not in response.headers: break - next_url = URL(response.url).with_path(response.headers["location"]) + next_url = URL(response.url).join(URL(response.headers["location"])) # Make a stub VCR request that we can then use to look up the recorded # VCR request saved to the cassette. This feels a little hacky and