]> git.plutz.net Git - shellwiki/commitdiff
Squashed 'cgilite/' changes from b2b268b..6cc62de
authorPaul Hänsch <paul@plutz.net>
Thu, 14 Apr 2022 13:15:58 +0000 (15:15 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 14 Apr 2022 13:15:58 +0000 (15:15 +0200)
6cc62de reset header variables when processing multiple requests

git-subtree-dir: cgilite
git-subtree-split: 6cc62de8c3909174b18d2a294cfaab70a0386799

cgilite.sh

index 6cbd7ec27eca272bff82a98bcf08fb2b24d55a46..7af962332cde39d1a4f0583da271159f8281f475 100755 (executable)
@@ -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#*: }";;