]> git.plutz.net Git - cgilite/commitdiff
perform _BASE striping outside of internal web server
authorPaul Hänsch <paul@plutz.net>
Thu, 7 Oct 2021 23:53:47 +0000 (01:53 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 7 Oct 2021 23:53:47 +0000 (01:53 +0200)
cgilite.sh

index 526a0fc738410dcfafa31017a836cc5ad7a71a03..310dd64a0f4e99280c99b1eca756e93e7f2aa97c 100755 (executable)
@@ -146,7 +146,6 @@ if [ -z "$REQUEST_METHOD" ]; then
 
     SERVER_PROTOCOL="${SERVER_PROTOCOL%${CR}}"
     PATH_INFO="$(HEX_DECODE % "${REQUEST_URI%\?*}" |PATH)"
-    PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
     [ "${REQUEST_URI}" = "${REQUEST_URI#*\?}" ] \
     && QUERY_STRING='' \
     || QUERY_STRING="${REQUEST_URI#*\?}"
@@ -196,6 +195,8 @@ if [ "${REQUEST_METHOD}" = POST -a "${CONTENT_LENGTH:-0}" -gt 0 -a \
   cgilite_post="$(head -c "$CONTENT_LENGTH")"
 fi
 
+PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
+
 debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; }
 [ "${DEBUG+x}" ] && env >&2