Skip to content
Snippets Groups Projects
Commit f2d6ec31 authored by John Xina's avatar John Xina
Browse files

Backport proxify to older python version

parent d63dc1ba
No related branches found
No related tags found
No related merge requests found
...@@ -99,13 +99,12 @@ class Asgiproxify(): ...@@ -99,13 +99,12 @@ class Asgiproxify():
}) })
async for chunk, _ in resp.content.iter_chunks(): async for chunk, _ in resp.content.iter_chunks():
try: try:
async with asyncio.timeout(10): await asyncio.wait_for(send({
await send({
'type': 'http.response.body', 'type': 'http.response.body',
'body': chunk, 'body': chunk,
'more_body': True, 'more_body': True,
}) }), timeout=10)
except TimeoutError: except asyncio.TimeoutError:
return return
await send({'type': 'http.response.body'}) await send({'type': 'http.response.body'})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment