summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2007-06-15 14:46:17 +0000
committerJan Kneschke <jan@kneschke.de>2007-06-15 14:46:17 +0000
commit022760f07ded9f01b3373fb13e39e3977f818434 (patch)
tree7c4ad96a9be676749c68a271cdb3272519e8b7dd /tests
parent8b06b122b1c664f2191e6270a96e7705db7ea89c (diff)
downloadlighttpd-git-022760f07ded9f01b3373fb13e39e3977f818434.tar.gz
check the URL twice, before and after path-info handling. (fixes #1230)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1871 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests')
-rw-r--r--tests/docroot/www/Makefile.am2
-rw-r--r--tests/docroot/www/index.html~0
-rwxr-xr-xtests/mod-access.t9
-rwxr-xr-xtests/prepare.sh1
4 files changed, 10 insertions, 2 deletions
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index 9198f56a..bcbd39c6 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
+ exec-date.shtml index.html~
SUBDIRS=go indexfile expire
diff --git a/tests/docroot/www/index.html~ b/tests/docroot/www/index.html~
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/docroot/www/index.html~
diff --git a/tests/mod-access.t b/tests/mod-access.t
index fb08db43..82275df3 100755
--- a/tests/mod-access.t
+++ b/tests/mod-access.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 3;
+use Test::More tests => 4;
use LightyTest;
my $tf = LightyTest->new();
@@ -23,5 +23,12 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
ok($tf->handle_http($t) == 0, 'forbid access to ...~');
+$t->{REQUEST} = ( <<EOF
+GET /index.html~/ HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
+ok($tf->handle_http($t) == 0, '#1230 - forbid access to ...~ - trailing slash');
+
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/prepare.sh b/tests/prepare.sh
index 040b6ee3..900ea16c 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -25,6 +25,7 @@ mkdir -p $tmpdir/cache/compress/
# copy everything into the right places
cp $srcdir/docroot/www/*.html \
$srcdir/docroot/www/*.php \
+ $srcdir/docroot/www/*.html~ \
$srcdir/docroot/www/*.pl \
$srcdir/docroot/www/*.fcgi \
$srcdir/docroot/www/*.shtml \