From: Paul Hänsch Date: Thu, 19 Nov 2020 01:32:51 +0000 (+0100) Subject: Merge commit 'b4afadf46825c28910365f4e6dce5ec20f6e1341' X-Git-Url: https://git.plutz.net/?p=httpchat;a=commitdiff_plain;h=7dbb8789442cb924b7c3ed4d7126ef9b3173ffc5;hp=edad361bef19f990287c7f7f9d21619e05e03952 Merge commit 'b4afadf46825c28910365f4e6dce5ec20f6e1341' --- diff --git a/cgilite/cgilite.sh b/cgilite/cgilite.sh index e145f2e..f766ee2 100755 --- a/cgilite/cgilite.sh +++ b/cgilite/cgilite.sh @@ -18,6 +18,9 @@ # You should have received a copy of the GNU Affero General Public License # along with CGIlite. If not, see . +[ -n "$include_cgilite" ] && return 0 +# guard set after webserver part + # ksh and zsh workaround # set -o posix # ksh, not portable setopt -o OCTAL_ZEROES 2>&- @@ -27,8 +30,6 @@ BR=' ' cgilite_timeout=2 -debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; } - PATH(){ local str seg out [ $# -eq 0 ] && str="$(cat)" || str="$*" @@ -121,11 +122,14 @@ if [ -z "$REQUEST_METHOD" ]; then exit 0 fi +include_cgilite="$0" + if [ "${REQUEST_METHOD}" = POST -a "${CONTENT_LENGTH:-0}" -gt 0 -a \ "${CONTENT_TYPE}" = "application/x-www-form-urlencoded" ]; then cgilite_post="$(head -c "$CONTENT_LENGTH")" fi +debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; } [ "${DEBUG+x}" ] && env >&2 cgilite_count(){