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

Capture effective URL in tornado

This commit is contained in:
Maarten van Schaik
2015-08-14 12:08:57 +02:00
parent d0aa5fddb7
commit 7d68f0577a
2 changed files with 12 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ def vcr_fetch_impl(cassette, real_fetch_impl):
reason=vcr_response['status']['message'],
headers=headers,
buffer=BytesIO(vcr_response['body']['string']),
effective_url=vcr_response.get('url'),
)
return callback(response)
else:
@@ -93,6 +94,7 @@ def vcr_fetch_impl(cassette, real_fetch_impl):
},
'headers': headers,
'body': {'string': response.body},
'url': response.effective_url,
}
cassette.append(vcr_request, vcr_response)
return callback(response)