ClickHouse/dbms/tests/queries/0_stateless/00416_progress_in_http_headers.sh
proller 083e9cc3aa Correct fix of building with external poco with disabled sending progress (#461)
* Correct fix of building with external poco with disabled sending progress

    Revert "Removed wrong code [#CLICKHOUSE-2]."

    This reverts commit 33f9917f53.

* fix
2017-02-07 23:45:55 +04:00

14 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
curl -vsS 'http://localhost:8123/?max_block_size=1&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0' -d 'SELECT number FROM system.numbers LIMIT 10' 2>&1 | grep -E 'Content-Encoding|X-ClickHouse|^[0-9]'
curl -sS 'http://localhost:8123/?max_block_size=1&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0&enable_http_compression=1' -H 'Accept-Encoding: gzip' -d 'SELECT number FROM system.numbers LIMIT 10' | gzip -d
# 'send_progress_in_http_headers' is false by default
curl -vsS 'http://localhost:8123/?max_block_size=1&http_headers_progress_interval_ms=0' -d 'SELECT number FROM system.numbers LIMIT 10' 2>&1 | grep -q 'X-ClickHouse-Progress' && echo 'Fail' || true
# have header?
curl -vsS 'http://localhost:8123/?max_block_size=1&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0&enable_http_compression=1' -H 'Accept-Encoding: gzip' -d 'SELECT number FROM system.numbers LIMIT 1' 2>&1 | grep -q "Content-Encoding: gzip" && true || echo 'Fail'
# nothing in body = no gzip
curl -vsS 'http://localhost:8123/?max_block_size=1&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0&enable_http_compression=1' -H 'Accept-Encoding: gzip' -d 'SELECT number FROM system.numbers LIMIT 0' 2>&1 | grep -q 'Content-Encoding: gzip' && echo 'Fail' || true