From 0023e2eeca6692c1cbb57e1d9ce97c85c577e447 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 20 Dec 2024 15:18:39 +0800 Subject: [PATCH] bugfix --- ahserver/globalEnv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ahserver/globalEnv.py b/ahserver/globalEnv.py index 38e681f..cefd270 100644 --- a/ahserver/globalEnv.py +++ b/ahserver/globalEnv.py @@ -52,7 +52,6 @@ async def stream_response(request, async_data_generator, content_type='text/html res = StreamResponse() if content_type: res.content_type = content_type - res.set_status(200) await res.prepare(request) async for d in async_data_generator(): if isinstance(d, bytes): @@ -62,6 +61,7 @@ async def stream_response(request, async_data_generator, content_type='text/html else: d = json.dumps(d) await res.write(d.encode('utf-8')) + await res.drain() await res.write_eof() return res