配置文件支持相对路径,http文件服务器防止访问根目录父目录

This commit is contained in:
xiongziliang
2019-10-18 09:51:20 +08:00
parent cbb25eadef
commit 67d2beb52a
6 changed files with 18 additions and 17 deletions

View File

@@ -44,10 +44,11 @@ MediaReader::MediaReader(const string &strVhost,const string &strApp, const stri
GET_CONFIG(string,recordPath,Record::kFilePath);
GET_CONFIG(bool,enableVhost,General::kEnableVhost);
if(enableVhost){
strFileName = recordPath + "/" + strVhost + "/" + strApp + "/" + strId;
strFileName = strVhost + "/" + strApp + "/" + strId;
}else{
strFileName = recordPath + "/" + strApp + "/" + strId;
strFileName = strApp + "/" + strId;
}
strFileName = File::absolutePath(strFileName,true,recordPath);
}
_hMP4File = MP4Read(strFileName.data());