upgrade core add header check and incrace upload speed
This commit is contained in:
+7
-2
@@ -91,7 +91,7 @@ void ServerProcessor::AppenedBlockedIP(DateTime::Span block_time, std::string ip
|
||||
IPList li{ ip };
|
||||
pimpl->BlockedIPs->Appened(expr_time, li);
|
||||
pimpl->BlockedIPs->Update();
|
||||
SCLOG_INFO("IP: [%s] has been blocked untill {%s}", ip.c_str(), std::string(expr_time).c_str());
|
||||
SCLOGF_INFO("IP: [{}] has been blocked untill {{{}}}", ip, std::string(expr_time));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,13 +136,18 @@ bool ServerProcessor::IsPathSafe(const std::string& raw_path)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ServerProcessor::IsHeaderValid(uns::RequestPtr request)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
uns::ResponsePtr ServerProcessor::Handle(uns::RequestPtr request)
|
||||
{
|
||||
std::string x_real_ip;
|
||||
if(request->GetImpl()->webcc_req->HasHeader("X-Real-IP"))
|
||||
x_real_ip = request->GetImpl()->webcc_req->GetHeader("X-Real-IP");
|
||||
std::string req_ip = (x_real_ip.empty() ? request->GetImpl()->webcc_req->address() : x_real_ip);
|
||||
SCLOGF_INFO("Request recived by {{{0}}}, ip: [{}], method: {}, URL: {}", RTTISubClassName(typeid(*this)), req_ip, request->GetImpl()->webcc_req->method(), request->GetImpl()->webcc_req->url().path());
|
||||
SCLOGF_INFO("Request recived by {{{}}}, ip: [{}], method: {}, URL: {}", RTTISubClassName(typeid(*this)), req_ip, request->GetImpl()->webcc_req->method(), request->GetImpl()->webcc_req->url().path());
|
||||
if (pimpl->IPCheck && (pimpl->BlockedIPs != nullptr))
|
||||
{
|
||||
pimpl->BlockedIPs->Update();
|
||||
|
||||
Reference in New Issue
Block a user