mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
新增是否开启浏览http目录的配置选项:#367
This commit is contained in:
parent
bbcb4d41f7
commit
41c75fb66a
@ -122,6 +122,8 @@ rootPath=./www
|
||||
sendBufSize=65536
|
||||
#https服务器监听端口
|
||||
sslport=443
|
||||
#是否显示文件夹菜单,开启后可以浏览文件夹
|
||||
dirMenu=1
|
||||
|
||||
[multicast]
|
||||
#rtp组播截止组播ip地址
|
||||
|
@ -100,11 +100,15 @@ const string kCharSet = HTTP_FIELD"charSet";
|
||||
const string kRootPath = HTTP_FIELD"rootPath";
|
||||
//http 404错误提示内容
|
||||
const string kNotFound = HTTP_FIELD"notFound";
|
||||
//是否显示文件夹菜单
|
||||
const string kDirMenu = HTTP_FIELD"dirMenu";
|
||||
|
||||
onceToken token([](){
|
||||
mINI::Instance()[kSendBufSize] = 64 * 1024;
|
||||
mINI::Instance()[kMaxReqSize] = 4*1024;
|
||||
mINI::Instance()[kKeepAliveSecond] = 15;
|
||||
mINI::Instance()[kDirMenu] = true;
|
||||
|
||||
#if defined(_WIN32)
|
||||
mINI::Instance()[kCharSet] = "gb2312";
|
||||
#else
|
||||
|
@ -193,6 +193,8 @@ extern const string kCharSet;
|
||||
extern const string kRootPath;
|
||||
//http 404错误提示内容
|
||||
extern const string kNotFound;
|
||||
//是否显示文件夹菜单
|
||||
extern const string kDirMenu;
|
||||
}//namespace Http
|
||||
|
||||
////////////SHELL配置///////////
|
||||
|
@ -195,6 +195,11 @@ static string searchIndexFile(const string &dir){
|
||||
}
|
||||
|
||||
static bool makeFolderMenu(const string &httpPath, const string &strFullPath, string &strRet) {
|
||||
GET_CONFIG(bool, dirMenu, Http::kDirMenu);
|
||||
if(!dirMenu){
|
||||
//不允许浏览文件夹
|
||||
return false;
|
||||
}
|
||||
string strPathPrefix(strFullPath);
|
||||
string last_dir_name;
|
||||
if(strPathPrefix.back() == '/'){
|
||||
|
Loading…
Reference in New Issue
Block a user