From dcfc9d7ae617d0c43a8a7934b328b5f247276408 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 17 Oct 2023 16:07:34 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index e124746..33e9249 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -327,10 +327,11 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): async def html_handle(self,request,filepath): async with aiofiles.open(filepath,'r', encoding='utf-8') as f: txt = await f.read() + utxt = txt.encode('utf-8') headers = { 'Content-Type': 'text/html; utf-8', 'Accept-Ranges': 'bytes', - 'Content-Length': str(len(txt)) + 'Content-Length': str(len(utxt)) } resp = Response(text=txt,headers=headers) return resp