X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=cgilite.sh;fp=cgilite.sh;h=7af962332cde39d1a4f0583da271159f8281f475;hp=6cbd7ec27eca272bff82a98bcf08fb2b24d55a46;hb=6cc62de8c3909174b18d2a294cfaab70a0386799;hpb=b2b268b458208ba7746052e05f1f1f5ced081023 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#*: }";;