优化文件上传速度,增加请求头预校验功能
This commit is contained in:
+9
-1
@@ -1,4 +1,4 @@
|
||||
#ifndef WEBCC_VIEW_H_
|
||||
#ifndef WEBCC_VIEW_H_
|
||||
#define WEBCC_VIEW_H_
|
||||
|
||||
#include <memory>
|
||||
@@ -25,6 +25,14 @@ public:
|
||||
virtual bool Stream(const std::string& /*method*/) {
|
||||
return false; // No streaming by default
|
||||
}
|
||||
|
||||
// 【核心新增】:请求头预校验虚函数
|
||||
// 当 Header 刚解析完毕、尚未接收 Body 时触发。
|
||||
// 返回 true 继续接收数据;返回 false 强行 RST 切断连接。
|
||||
virtual bool ValidateHeader(RequestPtr /*request*/)
|
||||
{
|
||||
return true; // 默认不校验,全放行
|
||||
}
|
||||
};
|
||||
|
||||
using ViewPtr = std::shared_ptr<View>;
|
||||
|
||||
Reference in New Issue
Block a user