From: Paul Hänsch Date: Thu, 14 Apr 2022 13:15:58 +0000 (+0200) Subject: Squashed 'cgilite/' changes from b2b268b..6cc62de X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=a6d9e4958fd35c6022ba71a6f6c6c3d210de94c2;p=shellwiki Squashed 'cgilite/' changes from b2b268b..6cc62de 6cc62de reset header variables when processing multiple requests git-subtree-dir: cgilite git-subtree-split: 6cc62de8c3909174b18d2a294cfaab70a0386799 --- diff --git a/cgilite.sh b/cgilite.sh index 6cbd7ec..7af9623 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -144,6 +144,8 @@ if [ -z "$REQUEST_METHOD" ]; then (sleep $cgilite_timeout && kill $$) & cgilite_watchdog=$! while read REQUEST_METHOD REQUEST_URI SERVER_PROTOCOL; do + unset PATH_INFO QUERY_STRING cgilite_headers CONTENT_LENGTH CONTENT_TYPE + [ "${SERVER_PROTOCOL#HTTP/1.[01]${CR}}" ] && break kill $cgilite_watchdog @@ -152,7 +154,7 @@ if [ -z "$REQUEST_METHOD" ]; then [ "${REQUEST_URI}" = "${REQUEST_URI#*\?}" ] \ && QUERY_STRING='' \ || QUERY_STRING="${REQUEST_URI#*\?}" - cgilite_headers=''; while read -r hl; do + while read -r hl; do hl="${hl%${CR}}"; [ "$hl" ] || break case $hl in 'Content-Length: '*) CONTENT_LENGTH="${hl#*: }";;