This commit is contained in:
Artur 2021-10-09 12:52:20 +00:00
parent 473f7bee3a
commit 12f59f2dca
2 changed files with 4 additions and 7 deletions

View File

@ -18,10 +18,7 @@
first_or_random - if first replica one has higher number of errors, pick a random one from replicas with minimum number of errors.
-->
<load_balancing>random</load_balancing>
<!-- Turn on this setting for CORS headers. -->
<!-- add_http_cors_header>1</add_http_cors_header -->
</default>
</default>
<!-- Profile that allows only read queries. -->
<readonly>

View File

@ -746,12 +746,12 @@ void HTTPHandler::processQuery(
static_cast<CompressedReadBuffer &>(*in_post_maybe_compressed).disableChecksumming();
/// 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
/// 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)
used_output.out->addHeaderCORS(settings.add_http_cors_header && !request.get("Origin", "").empty());
else if (settings.add_http_cors_header && !request.get("Origin", "").empty())
used_output.out->addHeaderCORS(true);
auto append_callback = [context = context] (ProgressCallback callback)
{