diff options
author | Stefan Bühler <stbuehler@web.de> | 2011-08-30 22:13:59 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2011-08-30 22:13:59 +0000 |
commit | e05f1b3eec1032bd25dc759f3c837b596775f458 (patch) | |
tree | 0f28af93ef274cd7dcc9b93f3dfb403e4302dead /tests/request.t | |
parent | cbf1baacc9b864cdc63eaf55c74c9ca8744210d8 (diff) | |
download | lighttpd-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-x | tests/request.t | 18 |
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"); |