From 055363df46ba92946301224b806e369090d6d9aa Mon Sep 17 00:00:00 2001 From: Jessie Murray Date: Mon, 21 Feb 2022 19:11:36 -0800 Subject: [PATCH] Add test with curl for empty header (#217) --- tests/curl-tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/curl-tests.sh b/tests/curl-tests.sh index adb59a4..f43aff6 100755 --- a/tests/curl-tests.sh +++ b/tests/curl-tests.sh @@ -25,4 +25,18 @@ function test_large_put_upload() { fi } +# GitHub issue #217 (empty header ":" returned for OPTIONS) +function test_options_headers() { + echo -n 'Sending an OPTIONS request... ' + empty_header_present=$(curl -v -X OPTIONS "http://127.0.0.1:7379/" 2>&1 | grep -cE '^< : ' || true) # || true to avoid false-positive exit code from grep + + if [[ $empty_header_present != 0 ]]; then + echo "failed! Found an empty header entry" + exit 1 + else + echo 'OK' + fi +} + test_large_put_upload +test_options_headers