Skip to content

Commit

Permalink
Add test with curl for empty header (nicolasff#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessie-murray committed Feb 22, 2022
1 parent 15302e7 commit 055363d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/curl-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 055363d

Please sign in to comment.