]> git.plutz.net Git - cgilite/commitdiff
bugfix: allow empty query string
authorPaul Hänsch <paul@plutz.net>
Wed, 3 Jun 2020 09:14:32 +0000 (11:14 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 3 Jun 2020 09:14:32 +0000 (11:14 +0200)
cgilite.sh

index bee93d86089668be13c59375026e7cfaa0464313..86ad28073018c9a2626877e74426c0b2d4a95914 100755 (executable)
@@ -77,7 +77,9 @@ if [ -z "$REQUEST_METHOD" ]; then
 
     SERVER_PROTOCOL="${SERVER_PROTOCOL%${CR}}"
     PATH_INFO="$(HEX_DECODE "${REQUEST_URI%\?*}" |PATH)"
-    QUERY_STRING="${REQUEST_URI#*\?}"
+    [ "${REQUEST_URI}" = "${REQUEST_URI#*\?}" ] \
+    && QUERY_STRING='' \
+    || QUERY_STRING="${REQUEST_URI#*\?}"
     cgilite_headers=''; while read -r hl; do
       hl="${hl%${CR}}"; [ "$hl" ] || break
       case $hl in