修复http文件服务器对特殊字符文件不兼容的bug:#1866

This commit is contained in:
ziyue
2022-08-10 10:37:49 +08:00
parent 099845b329
commit 795b4dbbd3
2 changed files with 19 additions and 26 deletions

View File

@@ -19,6 +19,7 @@
#include "HttpSession.h"
#include "Record/HlsMediaSource.h"
#include "Common/Parser.h"
#include "strCoding.h"
using namespace std;
using namespace toolkit;
@@ -124,7 +125,7 @@ static bool makeFolderMenu(const string &httpPath, const string &strFullPath, st
if (pDirent->d_name[0] == '.') {
continue;
}
file_map.emplace(pDirent->d_name, std::make_pair(pDirent->d_name, strPathPrefix + "/" + pDirent->d_name));
file_map.emplace(strCoding::UrlEncode(pDirent->d_name), std::make_pair(pDirent->d_name, strPathPrefix + "/" + pDirent->d_name));
}
//如果是root目录添加虚拟目录
if (httpPath == "/") {