From: Paul Hänsch Date: Thu, 7 Oct 2021 23:53:47 +0000 (+0200) Subject: perform _BASE striping outside of internal web server X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=24df501f00c9a9fc5ceebe1ff05e99888cca801b;p=cgilite perform _BASE striping outside of internal web server --- diff --git a/cgilite.sh b/cgilite.sh index 526a0fc..310dd64 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -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