]> git.plutz.net Git - cgilite/commitdiff
reset header variables when processing multiple requests
authorPaul Hänsch <paul@plutz.net>
Fri, 8 Apr 2022 10:39:19 +0000 (12:39 +0200)
committerPaul Hänsch <paul@plutz.net>
Fri, 8 Apr 2022 10:39:19 +0000 (12:39 +0200)
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#*: }";;