upgrade core add header check and incrace upload speed
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user