diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-12-23 00:38:43 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-12-23 03:50:13 -0500 |
commit | b598bb53f961cdc5743b034f646c7633806fc832 (patch) | |
tree | ca0e130a6df4ac66f52f208c99ad2f3686e455d9 /tests/docroot | |
parent | 89a3987ce7d6c109269d3370d464994d8feee5cf (diff) | |
download | lighttpd-git-b598bb53f961cdc5743b034f646c7633806fc832.tar.gz |
[tests] remove FastCGI test dependency on PHP
Diffstat (limited to 'tests/docroot')
-rw-r--r-- | tests/docroot/123/Makefile.am | 2 | ||||
-rw-r--r-- | tests/docroot/123/phpinfo.php | 1 | ||||
-rw-r--r-- | tests/docroot/www/Makefile.am | 7 | ||||
-rwxr-xr-x | tests/docroot/www/cgi.php | 9 | ||||
-rwxr-xr-x | tests/docroot/www/cgi.pl | 27 | ||||
-rw-r--r-- | tests/docroot/www/get-env.php | 4 | ||||
-rw-r--r-- | tests/docroot/www/get-server-env.php | 3 | ||||
-rw-r--r-- | tests/docroot/www/go/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/docroot/www/go/cgi.php | 9 | ||||
-rw-r--r-- | tests/docroot/www/indexfile/Makefile.am | 2 | ||||
-rw-r--r-- | tests/docroot/www/indexfile/index.php | 1 | ||||
-rw-r--r-- | tests/docroot/www/indexfile/index.pl | 8 | ||||
-rw-r--r-- | tests/docroot/www/indexfile/return-404.php | 5 | ||||
-rw-r--r-- | tests/docroot/www/phpinfo.php | 1 | ||||
-rw-r--r-- | tests/docroot/www/prefix.fcgi | 4 | ||||
-rw-r--r-- | tests/docroot/www/redirect.php | 4 | ||||
-rw-r--r-- | tests/docroot/www/sendfile.php | 13 |
17 files changed, 38 insertions, 63 deletions
diff --git a/tests/docroot/123/Makefile.am b/tests/docroot/123/Makefile.am index f77f883a..4652a4f9 100644 --- a/tests/docroot/123/Makefile.am +++ b/tests/docroot/123/Makefile.am @@ -1 +1 @@ -EXTRA_DIST=100.txt 12345.html 12345.txt dummyfile.bla phpinfo.php +EXTRA_DIST=100.txt 12345.html 12345.txt dummyfile.bla diff --git a/tests/docroot/123/phpinfo.php b/tests/docroot/123/phpinfo.php deleted file mode 100644 index 147cebcd..00000000 --- a/tests/docroot/123/phpinfo.php +++ /dev/null @@ -1 +0,0 @@ -<?php phpinfo(); ?> diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am index 1e2f6aef..72bbeb51 100644 --- a/tests/docroot/www/Makefile.am +++ b/tests/docroot/www/Makefile.am @@ -2,27 +2,20 @@ EXTRA_DIST=\ 404.html \ 404.pl \ cgi-pathinfo.pl \ - cgi.php \ cgi.pl \ crlfcrash.pl \ exec-date.shtml \ - get-env.php \ get-header.pl \ get-post-len.pl \ - get-server-env.php \ index.html \ index.txt \ ip.pl \ nph-status.pl \ - phpinfo.php \ prefix.fcgi \ - redirect.php \ send404.pl \ - sendfile.php \ ssi-include.shtml \ ssi-include.txt \ ssi.shtml SUBDIRS=\ expire \ - go \ indexfile diff --git a/tests/docroot/www/cgi.php b/tests/docroot/www/cgi.php deleted file mode 100755 index f59a8401..00000000 --- a/tests/docroot/www/cgi.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -#ob_start(/*"ob_gzhandler"*/); -print "12345<br />\n"; -#phpinfo(); -#header("Content-Length: ".ob_get_length()); -#ob_end_flush(); - -?> diff --git a/tests/docroot/www/cgi.pl b/tests/docroot/www/cgi.pl index f7296f8b..c149cee1 100755 --- a/tests/docroot/www/cgi.pl +++ b/tests/docroot/www/cgi.pl @@ -5,6 +5,33 @@ if ($ENV{"QUERY_STRING"} eq "internal-redir") { exit 0; } +if ($ENV{"QUERY_STRING"} eq "external-redir") { + print "Location: http://www.example.org:2048/\r\n\r\n"; + exit 0; +} + +# X-Sendfile +if ($ENV{"QUERY_STRING"} eq "xsendfile") { + # urlencode path for CGI header + # (including urlencode ',' if in path, for X-Sendfile2 w/ FastCGI (not CGI)) + # (This implementation is not minimal encoding; + # encode everything that is not alphanumeric, '.' '_', '-', '/') + require Cwd; + my $path = Cwd::getcwd() . "/index.txt"; + $path =~ s#([^\w./-])#"%".unpack("H2",$1)#eg; + + print "Status: 200\r\n"; + print "X-Sendfile: $path\r\n\r\n"; + exit 0; +} + +# env +if ($ENV{"QUERY_STRING"} =~ /^env=(\w+)/) { + print "Status: 200\r\n\r\n$ENV{$1}"; + exit 0; +} + +# default print "Content-Type: text/html\r\n\r\n"; print $ENV{"SCRIPT_NAME"}; diff --git a/tests/docroot/www/get-env.php b/tests/docroot/www/get-env.php deleted file mode 100644 index cd7fa040..00000000 --- a/tests/docroot/www/get-env.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php - $env = $_GET["env"]; - print isset($_ENV[$env]) ? $_ENV[$env] : ''; -?> diff --git a/tests/docroot/www/get-server-env.php b/tests/docroot/www/get-server-env.php deleted file mode 100644 index 64d93124..00000000 --- a/tests/docroot/www/get-server-env.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - print $_SERVER[$_GET["env"]]; -?> diff --git a/tests/docroot/www/go/Makefile.am b/tests/docroot/www/go/Makefile.am deleted file mode 100644 index fe20c503..00000000 --- a/tests/docroot/www/go/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST=cgi.php diff --git a/tests/docroot/www/go/cgi.php b/tests/docroot/www/go/cgi.php deleted file mode 100755 index f59a8401..00000000 --- a/tests/docroot/www/go/cgi.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -#ob_start(/*"ob_gzhandler"*/); -print "12345<br />\n"; -#phpinfo(); -#header("Content-Length: ".ob_get_length()); -#ob_end_flush(); - -?> diff --git a/tests/docroot/www/indexfile/Makefile.am b/tests/docroot/www/indexfile/Makefile.am index 333c0c56..140163d3 100644 --- a/tests/docroot/www/indexfile/Makefile.am +++ b/tests/docroot/www/indexfile/Makefile.am @@ -1 +1 @@ -EXTRA_DIST=index.php return-404.php query_string.pl +EXTRA_DIST=index.pl query_string.pl diff --git a/tests/docroot/www/indexfile/index.php b/tests/docroot/www/indexfile/index.php deleted file mode 100644 index e0c7d9ec..00000000 --- a/tests/docroot/www/indexfile/index.php +++ /dev/null @@ -1 +0,0 @@ -<?php print $_SERVER["PHP_SELF"]; ?> diff --git a/tests/docroot/www/indexfile/index.pl b/tests/docroot/www/indexfile/index.pl new file mode 100644 index 00000000..dbf047b9 --- /dev/null +++ b/tests/docroot/www/indexfile/index.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl + +if ($ENV{REDIRECT_STATUS}) { + print "Status: $ENV{REDIRECT_STATUS}\r\n\r\n$ENV{SCRIPT_NAME}"; + exit 0; +} + +print "Status: 200\r\n\r\n"; diff --git a/tests/docroot/www/indexfile/return-404.php b/tests/docroot/www/indexfile/return-404.php deleted file mode 100644 index 2adaaeaa..00000000 --- a/tests/docroot/www/indexfile/return-404.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - header("Status: 404"); - - print $_SERVER["PHP_SELF"]; -?> diff --git a/tests/docroot/www/phpinfo.php b/tests/docroot/www/phpinfo.php deleted file mode 100644 index 147cebcd..00000000 --- a/tests/docroot/www/phpinfo.php +++ /dev/null @@ -1 +0,0 @@ -<?php phpinfo(); ?> diff --git a/tests/docroot/www/prefix.fcgi b/tests/docroot/www/prefix.fcgi index e3883520..f091de63 100644 --- a/tests/docroot/www/prefix.fcgi +++ b/tests/docroot/www/prefix.fcgi @@ -1,3 +1 @@ -<?php -echo $_SERVER[$_GET["var"]]; -?> +# (file exists for mod-fastcgi.t test case) diff --git a/tests/docroot/www/redirect.php b/tests/docroot/www/redirect.php deleted file mode 100644 index 0489d22d..00000000 --- a/tests/docroot/www/redirect.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php - - header('Location: http://www.example.org:2048/'); -?> diff --git a/tests/docroot/www/sendfile.php b/tests/docroot/www/sendfile.php deleted file mode 100644 index e4602203..00000000 --- a/tests/docroot/www/sendfile.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -function pathencode($path) { - return str_replace(',', '%2c', urlencode($path)); -} - -$val = "X-Sendfile2: " . pathencode(getcwd() . "/index.txt") . " " . $_GET["range"]; - -if (isset($_GET["range2"])) $val .= ", " . pathencode(getcwd() . "/index.txt") . " " . $_GET["range2"]; - -header($val); - -?>
\ No newline at end of file |