mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Check for duplicates
This commit is contained in:
parent
87601d461f
commit
bdff47973a
@ -1705,7 +1705,8 @@ void executeQuery(
|
||||
|| std::find_if(value.begin(), value.end(), isControlASCII) != value.end())
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "The values of the `additional_http_headers` cannot contain ASCII control characters");
|
||||
|
||||
result_details.additional_headers.emplace(key, value);
|
||||
if (!result_details.additional_headers.emplace(key, value).second)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "There are duplicate entries in the `additional_http_headers` setting");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,3 +13,5 @@ Check that we can override it:
|
||||
It does not allow bad characters:
|
||||
BAD_ARGUMENTS
|
||||
BAD_ARGUMENTS
|
||||
It does not let duplicate entries:
|
||||
BAD_ARGUMENTS
|
||||
|
@ -19,3 +19,6 @@ ${CLICKHOUSE_CURL} -sS --globoff -v "http://localhost:8123/?http_response_header
|
||||
echo "It does not allow bad characters:"
|
||||
${CLICKHOUSE_CURL} -sS --globoff -v "http://localhost:8123/" -d "SELECT 1 SETTINGS http_response_headers = \$\${'My-New-Header':'Hello,\n\nworld.'}\$\$" 2>&1 | grep -o -F 'BAD_ARGUMENTS'
|
||||
${CLICKHOUSE_CURL} -sS --globoff -v "http://localhost:8123/" -d "SELECT 1 SETTINGS http_response_headers = \$\${'My\rNew-Header':'Hello, world.'}\$\$" 2>&1 | grep -o -F 'BAD_ARGUMENTS'
|
||||
|
||||
echo "It does not let duplicate entries:"
|
||||
${CLICKHOUSE_CURL} -sS --globoff -v "http://localhost:8123/" -d "SELECT 1 SETTINGS http_response_headers = \$\${'a':'b','a':'c'}\$\$" 2>&1 | grep -o -F 'BAD_ARGUMENTS'
|
||||
|
Loading…
Reference in New Issue
Block a user