summaryrefslogtreecommitdiff
path: root/tests/docroot
diff options
context:
space:
mode:
Diffstat (limited to 'tests/docroot')
-rwxr-xr-xtests/docroot/www/404.fcgi27
-rw-r--r--tests/docroot/www/404.html1
-rwxr-xr-xtests/docroot/www/404.pl33
-rw-r--r--tests/docroot/www/Makefile.am2
-rw-r--r--tests/docroot/www/Makefile.in2
-rw-r--r--tests/docroot/www/crlfcrash.pl4
-rwxr-xr-xtests/docroot/www/nph-status.pl8
-rwxr-xr-xtests/docroot/www/send404.pl5
8 files changed, 79 insertions, 3 deletions
diff --git a/tests/docroot/www/404.fcgi b/tests/docroot/www/404.fcgi
new file mode 100755
index 0000000..468089f
--- /dev/null
+++ b/tests/docroot/www/404.fcgi
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#use CGI qw/:standard/;
+use CGI::Fast qw(:standard);
+my $cgi = new CGI;
+while (new CGI::Fast) {
+ my $request_uri = $ENV{'REQUEST_URI'};
+ print (STDERR "REQUEST_URI: $request_uri\n");
+ if ($request_uri =~ m/^\/dynamic\/200\// ) {
+ print header ( -status => 200,
+ -type => 'text/plain' );
+ print ("found here\n");
+ }
+ elsif ($request_uri =~ m|^/dynamic/302/| ) {
+ print header( -status=>302,
+ -location => 'http://www.example.org/');
+ }
+ elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
+ print header ( -status => 404
+ -type => 'text/plain' );
+ print ("Not found here\n");
+ }
+ else {
+ print header ( -status => 500,
+ -type => 'text/plain');
+ print ("huh\n");
+ };
+};
diff --git a/tests/docroot/www/404.html b/tests/docroot/www/404.html
new file mode 100644
index 0000000..ce72e89
--- /dev/null
+++ b/tests/docroot/www/404.html
@@ -0,0 +1 @@
+static not found
diff --git a/tests/docroot/www/404.pl b/tests/docroot/www/404.pl
new file mode 100755
index 0000000..0f743d0
--- /dev/null
+++ b/tests/docroot/www/404.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+use CGI qw/:standard/;
+my $cgi = new CGI;
+my $request_uri = $ENV{'REQUEST_URI'};
+print (STDERR "REQUEST_URI: $request_uri\n");
+
+if ($request_uri =~ m/^\/dynamic\/200\// ) {
+ print header ( -status => 200,
+ -type => 'text/plain' );
+ print ("found here\n");
+}
+elsif ($request_uri =~ m|^/dynamic/302/| ) {
+ print header( -status=>302,
+ -location => 'http://www.example.org/');
+}
+elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
+ print header ( -status => 404
+ -type => 'text/plain' );
+ print ("Not found here\n");
+}
+elsif ($request_uri =~ m/^\/send404\.pl/ ) {
+ print header ( -status => 404
+ -type => 'text/plain' );
+ print ("Not found here (send404)\n");
+}
+elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) {
+ print ("found here\n");
+}
+else {
+ print header ( -status => 500,
+ -type => 'text/plain');
+ print ("huh\n");
+};
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index bcbd39c..7c8aa55 100644
--- a/tests/docroot/www/Makefile.am
+++ b/tests/docroot/www/Makefile.am
@@ -1,5 +1,5 @@
EXTRA_DIST=cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \
redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \
nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \
- exec-date.shtml index.html~
+ exec-date.shtml index.html~ 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl
SUBDIRS=go indexfile expire
diff --git a/tests/docroot/www/Makefile.in b/tests/docroot/www/Makefile.in
index 393c611..7597926 100644
--- a/tests/docroot/www/Makefile.in
+++ b/tests/docroot/www/Makefile.in
@@ -196,7 +196,7 @@ top_srcdir = @top_srcdir@
EXTRA_DIST = cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \
redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \
nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \
- exec-date.shtml index.html~
+ exec-date.shtml index.html~ 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl
SUBDIRS = go indexfile expire
all: all-recursive
diff --git a/tests/docroot/www/crlfcrash.pl b/tests/docroot/www/crlfcrash.pl
new file mode 100644
index 0000000..f90bc86
--- /dev/null
+++ b/tests/docroot/www/crlfcrash.pl
@@ -0,0 +1,4 @@
+#!/usr/bin/env perl
+#
+print "Location: http://www.example.org/\r\n\n\n";
+exit;
diff --git a/tests/docroot/www/nph-status.pl b/tests/docroot/www/nph-status.pl
index 528791b..d817c7f 100755
--- a/tests/docroot/www/nph-status.pl
+++ b/tests/docroot/www/nph-status.pl
@@ -1,4 +1,10 @@
#!/usr/bin/perl
-print "HTTP/1.0 30 FooBar\r\n";
+my $status = 200;
+
+if (defined $ENV{"QUERY_STRING"}) {
+ $status = $ENV{"QUERY_STRING"};
+}
+
+print "HTTP/1.0 ".$status." FooBar\r\n";
print "\r\n";
diff --git a/tests/docroot/www/send404.pl b/tests/docroot/www/send404.pl
new file mode 100755
index 0000000..a92dfa6
--- /dev/null
+++ b/tests/docroot/www/send404.pl
@@ -0,0 +1,5 @@
+#!/usr/bin/perl
+use CGI qw/:standard/;
+print header ( -status => 404
+ -type => 'text/plain' );
+print ("send404\n");