refactoring

This commit is contained in:
Artur 2021-10-09 12:56:00 +00:00
parent 12f59f2dca
commit a853cd57ca

View File

@ -748,10 +748,13 @@ void HTTPHandler::processQuery(
/// Add CORS header if 'add_http_cors_header' setting is turned on send * in Access-Control-Allow-Origin,
/// or if config has http_options_response, which means that there
/// are some headers to be sent, and the client passed Origin header.
if (config.has("http_options_response") && !request.get("Origin", "").empty())
tryAddHeadersFromConfig(response, config);
else if (settings.add_http_cors_header && !request.get("Origin", "").empty())
used_output.out->addHeaderCORS(true);
if (!request.get("Origin", "").empty())
{
if (config.has("http_options_response"))
tryAddHeadersFromConfig(response, config);
else if (settings.add_http_cors_header)
used_output.out->addHeaderCORS(true);
}
auto append_callback = [context = context] (ProgressCallback callback)
{