We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 856f247 commit e7d3348Copy full SHA for e7d3348
tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py
@@ -95,7 +95,11 @@ def play_responses(cassette, vcr_request):
95
# If we're following redirects, continue playing until we reach
96
# our final destination.
97
while 300 <= response.status <= 399:
98
- next_url = URL(response.url).with_path(response.headers["location"])
+ new_location = response.headers["location"]
99
+ potential_next_url = URL(new_location)
100
+ next_url = (potential_next_url
101
+ if potential_next_url.is_absolute()
102
+ else URL(response.url).with_path(new_location))
103
104
# Make a stub VCR request that we can then use to look up the recorded
105
# VCR request saved to the cassette. This feels a little hacky and
0 commit comments