Skip to content

Commit

Permalink
passthrough: make it work with binary data, closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcarneiro authored and brycedrennan committed Dec 8, 2019
1 parent 94ea9a0 commit 945296d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aresponses/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ async def passthrough(self, request):
async with ClientSession(connector=connector) as session:
async with getattr(session, request.method.lower())(original_request.url, headers=headers, data=(await request.read())) as r:
headers = {k: v for k, v in r.headers.items() if k.lower() == "content-type"}
text = await r.text()
response = self.Response(text=text, status=r.status, headers=headers)
data = await r.read()
response = self.Response(body=data, status=r.status, headers=headers)
return response
finally:
ClientRequest.is_ssl = new_is_ssl
Expand Down

0 comments on commit 945296d

Please sign in to comment.