summaryrefslogtreecommitdiff
path: root/tests/request.t
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2011-08-30 22:13:59 +0000
committerStefan Bühler <stbuehler@web.de>2011-08-30 22:13:59 +0000
commite05f1b3eec1032bd25dc759f3c837b596775f458 (patch)
tree0f28af93ef274cd7dcc9b93f3dfb403e4302dead /tests/request.t
parentcbf1baacc9b864cdc63eaf55c74c9ca8744210d8 (diff)
downloadlighttpd-git-e05f1b3eec1032bd25dc759f3c837b596775f458.tar.gz
Add static-file.disable-pathinfo option to prevent handling of urls like .../secret.php/image.jpg as static file
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2803 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/request.t')
-rwxr-xr-xtests/request.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/request.t b/tests/request.t
index 5c2dfd5b..c4bd9581 100755
--- a/tests/request.t
+++ b/tests/request.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 44;
+use Test::More tests => 46;
use LightyTest;
my $tf = LightyTest->new();
@@ -413,5 +413,21 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-
$t->{SLOWREQUEST} = 1;
ok($tf->handle_http($t) == 0, 'GET, slow \\r\\n\\r\\n (#2105)');
+print "\nPathinfo for static files\n";
+$t->{REQUEST} = ( <<EOF
+GET /image.jpg/index.php HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/jpeg' } ];
+ok($tf->handle_http($t) == 0, 'static file accepting pathinfo by default');
+
+$t->{REQUEST} = ( <<EOF
+GET /image.jpg/index.php HTTP/1.0
+Host: zzz.example.org
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
+ok($tf->handle_http($t) == 0, 'static file with forbidden pathinfo');
+
ok($tf->stop_proc == 0, "Stopping lighttpd");