mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
接口端【调整】:因容易出现误判,取消接口端上传文件是否包含木马流的检测功能,待找到更合理解决方案再完善。
This commit is contained in:
@@ -373,16 +373,16 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
|
||||
// 使用StreamReader来读取文件内容
|
||||
using (var reader = new StreamReader(file.OpenReadStream(), Encoding.UTF8))
|
||||
{
|
||||
var content = await reader.ReadToEndAsync(); // 注意:这可能会消耗大量内存对于大文件,所以需要限制上传大小
|
||||
// 检查内容是否合法
|
||||
if (CommonHelper.CheckData(content))
|
||||
{
|
||||
jm.msg = "请勿提交非法数据。";
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
//using (var reader = new StreamReader(file.OpenReadStream(), Encoding.UTF8))
|
||||
//{
|
||||
// var content = await reader.ReadToEndAsync(); // 注意:这可能会消耗大量内存对于大文件,所以需要限制上传大小
|
||||
// // 检查内容是否合法
|
||||
// if (CommonHelper.CheckData(content))
|
||||
// {
|
||||
// jm.msg = "请勿提交非法数据。";
|
||||
// return jm;
|
||||
// }
|
||||
//}
|
||||
|
||||
var url = string.Empty;
|
||||
if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString())
|
||||
@@ -437,11 +437,11 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
return jm;
|
||||
}
|
||||
|
||||
if (CommonHelper.CheckData(entity.base64))
|
||||
{
|
||||
jm.msg = "请勿提交非法内容。";
|
||||
return jm;
|
||||
}
|
||||
//if (CommonHelper.CheckData(entity.base64))
|
||||
//{
|
||||
// jm.msg = "请勿提交非法内容。";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
//检查上传大小
|
||||
if (!CommonHelper.CheckBase64Size(entity.base64, filesStorageOptions.MaxSize))
|
||||
|
||||
Reference in New Issue
Block a user