upgrade core add header check and incrace upload speed

This commit is contained in:
UnknownObject
2026-08-05 17:35:27 +08:00
parent 45af94e535
commit 1f11a9d348
76 changed files with 2059 additions and 642 deletions
+3 -3
View File
@@ -740,18 +740,18 @@ uns::ResponseBuilder& uns::ResponseBuilder::AutoCORS(uns::RequestPtr req)
std::string host = req->GetImpl()->webcc_req->HasHeader("Host") ? req->GetImpl()->webcc_req->GetHeader("Host") : "";
if(host.empty() || GlobalCORSConfig.HostValidate(host))
{
SCLOG_INFO("Applied CORS headers for origin=%s cred=%d", origin.c_str(), GlobalCORSConfig.AllowCookie() ? 1 : 0);
SCLOGF_INFO("Applied CORS headers for origin={} cred={}", origin, GlobalCORSConfig.AllowCookie() ? 1 : 0);
return CORS(origin);
}
else
{
SCLOG_WARNING("Actual request: Host not allowed: %s", host.c_str());
SCLOGF_WARNING("Actual request: Host not allowed: {}", host);
return Forbidden().Body(std::string("CORS ERROR"));
}
}
else
{
SCLOG_WARNING("Actual request: Origin not allowed: %s", origin.c_str());
SCLOGF_WARNING("Actual request: Origin not allowed: {}", origin);
return Forbidden().Body(std::string("CORS ERROR"));
}
}