From 3192ec1b4054bcc228dfb88e57d5e1c828682a7b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 2 Nov 2013 10:54:17 +0000 Subject: add extras for exec_cgi and try_gzip_static These applications are what I'll be using to run on yahns on my personal server. Including them here will be helpful for me to find bugs. I've already found some, the following commits were directly the result of playing with these extras: * stream_file: only close FDs we opened ourselves * worker-less server should not waitpid indiscriminately * http: do not drop Content-Range from response headers --- test/test_extras_exec_cgi.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/test_extras_exec_cgi.sh (limited to 'test/test_extras_exec_cgi.sh') diff --git a/test/test_extras_exec_cgi.sh b/test/test_extras_exec_cgi.sh new file mode 100755 index 0000000..e580773 --- /dev/null +++ b/test/test_extras_exec_cgi.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (C) 2013, Eric Wong 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 + ;; +/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 -- cgit v1.2.3-24-ge0c7