Sha256: 275c9ab4902631a213467668c0e7d535c63108b8d0d65f366212b82639d2dc7a

Contents?: true

Size: 842 Bytes

Versions: 12

Compression:

Stored size: 842 Bytes

Contents

#!/bin/sh
# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)

# test CGI program, this remains portable POSIX shell (not bash)
set -e

stdhead () {
	echo Content-Type: text/plain
	echo Status: 200 OK
	echo
}

case $PATH_INFO in
/)
	stdhead
	echo HIHI
	;;
/env)
	stdhead
	env
	;;
/pid)
	stdhead
	echo $$
	;;
/die)
	if test -n "$HTTP_X_PID_DEST"
	then
		# obviously this is only for testing on a local machine:
		echo $$ > "$HTTP_X_PID_DEST"
		exit 1
	else
		echo Content-Type: text/plain
		echo Status: 400 Bad Request
		echo Content-Length: 0
		echo
	fi
	;;
/known-length)
	echo Content-Type: text/plain
	echo Status: 200 OK
	echo Content-Length: 5
	echo
	echo HIHI
	;;
*)
	echo Content-Type: text/plain
	echo Status: 404 Not Found
	echo
	;;
esac

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
yahns-1.9.0 test/test_extras_exec_cgi.sh
yahns-1.8.0 test/test_extras_exec_cgi.sh
yahns-1.7.0 test/test_extras_exec_cgi.sh
yahns-1.6.0 test/test_extras_exec_cgi.sh
yahns-1.5.0 test/test_extras_exec_cgi.sh
yahns-1.4.0 test/test_extras_exec_cgi.sh
yahns-1.3.1 test/test_extras_exec_cgi.sh
yahns-1.3.0 test/test_extras_exec_cgi.sh
yahns-1.2.0 test/test_extras_exec_cgi.sh
yahns-1.1.0 test/test_extras_exec_cgi.sh
yahns-1.0.0 test/test_extras_exec_cgi.sh
yahns-0.0.3 test/test_extras_exec_cgi.sh