mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
fix: usage of io-like interface with VCR.py (#906)
* fix: usage of io-like interface with VCR.py * Update tests/integration/test_aiohttp.py Co-authored-by: Jair Henrique <jair.henrique@gmail.com> --------- Co-authored-by: Jair Henrique <jair.henrique@gmail.com>
This commit is contained in:
@@ -20,7 +20,12 @@ class Request:
|
||||
self._was_file = hasattr(body, "read")
|
||||
self._was_iter = _is_nonsequence_iterator(body)
|
||||
if self._was_file:
|
||||
self.body = body.read()
|
||||
if hasattr(body, "tell"):
|
||||
tell = body.tell()
|
||||
self.body = body.read()
|
||||
body.seek(tell)
|
||||
else:
|
||||
self.body = body.read()
|
||||
elif self._was_iter:
|
||||
self.body = list(body)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user