Allow empty HTTP headers

This commit is contained in:
Ivan Lezhankin 2021-05-19 16:20:23 +03:00
parent 87eedfded8
commit 33f816d28d
3 changed files with 2 additions and 4 deletions

View File

@ -123,7 +123,7 @@ inline bool isWhitespaceASCII(char c)
/// Since |isWhiteSpaceASCII()| is used inside algorithms it's easier to implement another function than add extra argument. /// Since |isWhiteSpaceASCII()| is used inside algorithms it's easier to implement another function than add extra argument.
inline bool isWhitespaceASCIIOneLine(char c) inline bool isWhitespaceASCIIOneLine(char c)
{ {
return c == ' ' || c == '\t' || c == '\r' || c == '\f' || c == '\v'; return c == ' ' || c == '\t' || c == '\f' || c == '\v';
} }
inline bool isControlASCII(char c) inline bool isControlASCII(char c)

View File

@ -68,9 +68,6 @@ void readHeaders(
if (in.eof()) if (in.eof())
throw Poco::Net::MessageException("Field is invalid"); throw Poco::Net::MessageException("Field is invalid");
if (value.empty())
throw Poco::Net::MessageException("Field value is empty");
if (ch == '\n') if (ch == '\n')
throw Poco::Net::MessageException("No CRLF found"); throw Poco::Net::MessageException("No CRLF found");

View File

@ -4,6 +4,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh # shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh . "$CURDIR"/../shell_config.sh
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'EmptyHeader;' -d 'SELECT 1'
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-User: default' -d 'SELECT 1' ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-User: default' -d 'SELECT 1'
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-User: header_test' -d 'SELECT 1' | grep -o 'Code: 516' ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-User: header_test' -d 'SELECT 1' | grep -o 'Code: 516'
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-Key: ' -d 'SELECT 1' ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -H 'X-ClickHouse-Key: ' -d 'SELECT 1'