From 0f39565f6733b8bcadb45f6889551f394654a73a Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 31 Jan 2021 18:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttp=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E4=B8=8D=E5=8F=91=E9=80=81content-type=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 95815457..8f10ca2d 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -547,7 +547,7 @@ void HttpSession::sendResponse(int code, pcContentType = "text/plain"; } - if(size && pcContentType){ + if((size || no_content_length) && pcContentType){ //有body时,设置文件类型 string strContentType = pcContentType; strContentType += "; charset=";