]> git.plutz.net Git - cgilite/commitdiff
allow empty script headers
authorPaul Hänsch <paul@plutz.net>
Tue, 26 May 2020 23:12:29 +0000 (01:12 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 26 May 2020 23:12:29 +0000 (01:12 +0200)
cgilite.sh

index 333334c460f5cae9bc763f0079584a41132f70c5..4c6de8ca6b784a5a361fb5cd8d70208c1a4d701d 100755 (executable)
@@ -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}";;