From 7335b7357a3be377ba5ae85bddc603948a4d3183 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 27 May 2020 01:12:29 +0200 Subject: [PATCH] allow empty script headers --- cgilite.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgilite.sh b/cgilite.sh index 333334c..4c6de8c 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -87,9 +87,9 @@ if [ -z "$REQUEST_METHOD" ]; then . "$0" | while read -r l; do case $l in Status:*) cgilite_status="${l#Status: }";; Content-Length:*) cgilite_cl="${l}";; - $CR) printf '%s %s\r\n%s\n%s\n\r\n' \ + $CR) printf '%s %s\r\n%s%s\n\r\n' \ 'HTTP/1.1' "${cgilite_status%${CR}}" \ - "$cgilite_response" "${cgilite_cl}" + "${cgilite_response}${cgilite_response:+${BR}}" "${cgilite_cl}" cat || kill $$ [ "${cgilite_cl#Connection}" = "${cgilite_cl}" ]; exit;; *) cgilite_response="${cgilite_response:+${cgilite_response}${BR}}${l}";; -- 2.39.2