upgrade core add header check and incrace upload speed
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
#include "Global.h"
|
||||
#include "IPTable.h"
|
||||
#include <functional>
|
||||
#include "WebFileInfo.h"
|
||||
#include "HTTPObjects.h"
|
||||
#include "TempFileManager.h"
|
||||
|
||||
using FileProcessorCallback = std::function<void(WebFileInfoVec, const std::string&)>;
|
||||
using FileProcessorCallback = std::function<void(TempFileManager&, const std::string&)>;
|
||||
|
||||
class UNSWSC_DLL_EXPORT FileReceiver
|
||||
{
|
||||
@@ -29,12 +29,19 @@ public:
|
||||
uns::HTTPMethod GetMethod(uns::RequestPtr request);
|
||||
void AppenedBlockedIP(DateTime::Span block_time, std::string ip);
|
||||
bool WriteFile(const std::string& path, const std::string& bytes);
|
||||
void SetFileTimeout(std::chrono::seconds timeout = 0s, std::chrono::seconds max_proc_timeout = 0s) noexcept;
|
||||
|
||||
public:
|
||||
// 请求信息预检,重载以在保存文件之前检查请求体
|
||||
virtual uns::Status PreCheckRequest(uns::RequestPtr request) = 0;
|
||||
// 表单预检,重载以在处理表单前检查表单
|
||||
virtual bool PreCheckForm(uns::FormPartPtr form) = 0;
|
||||
// 路径穿越配置,重载以配置允许的路径穿越类型
|
||||
virtual uns::PathTraversalDefenceLevel PTDefence();
|
||||
// 路径穿越防护,重载以实现路径穿越检查,配置为AutoNormalize或AllowNormal时必须,否则自动退化为DenyAll
|
||||
virtual bool IsPathSafe(const std::string& raw_path);
|
||||
// 请求头预检,重载以实现在接收请求体之前检查请求头,返回false则服务器将强制关闭连接
|
||||
virtual bool IsHeaderValid(uns::RequestPtr request);
|
||||
|
||||
public:
|
||||
// 核心驱动入口:供内部适配器调用的实际执行流
|
||||
|
||||
Reference in New Issue
Block a user