From a5c3db4ee12ebfd1f9cd36387f47e6cbe72d2266 Mon Sep 17 00:00:00 2001 From: baiyfcu Date: Fri, 3 Mar 2023 14:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=BB=E8=BE=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=B8=8D=E4=B8=A5=E7=A6=81XSS=E6=94=BB=E5=87=BB?= =?UTF-8?q?=EF=BC=8Cserver=E5=9C=A8windows=20debug=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E6=8B=92=E7=BB=9D=E6=9C=8D=E5=8A=A1=E6=94=BB=E5=87=BB?= =?UTF-8?q?=EF=BC=9A#2213?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpFileManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Http/HttpFileManager.cpp b/src/Http/HttpFileManager.cpp index 7e71186c..b690801a 100644 --- a/src/Http/HttpFileManager.cpp +++ b/src/Http/HttpFileManager.cpp @@ -496,6 +496,10 @@ void HttpFileManager::onAccessPath(Session &sender, Parser &parser, const HttpFi auto fullUrl = string(HTTP_SCHEMA) + "://" + parser["Host"] + parser.FullUrl(); MediaInfo media_info(fullUrl); auto file_path = getFilePath(parser, media_info, sender); + if (file_path.size() == 0) { + sendNotFound(cb); + return; + } //访问的是文件夹 if (File::is_dir(file_path.data())) { auto indexFile = searchIndexFile(file_path);