the range-request options was not handled at all, added test case
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@781 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/lighttpd-1.4.6
parent
3a6769d19b
commit
a77f7a90d8
|
@ -445,7 +445,7 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) {
|
|||
|
||||
if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) {
|
||||
return HANDLER_FINISHED;
|
||||
} else if (con->request.http_range) {
|
||||
} else if (con->request.http_range && con->conf.range_requests) {
|
||||
/* content prepared, I'm done */
|
||||
con->file_finished = 1;
|
||||
|
||||
|
|
|
@ -73,6 +73,10 @@ setenv.add-environment = ( "TRAC_ENV" => "tracenv", "SETENV" => "setenv")
|
|||
setenv.add-request-header = ( "FOO" => "foo")
|
||||
setenv.add-response-header = ( "BAR" => "foo")
|
||||
|
||||
$HTTP["url"] =~ "\.pdf$" {
|
||||
server.range-requests = "disable"
|
||||
}
|
||||
|
||||
fastcgi.debug = 0
|
||||
fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ),
|
||||
"/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )
|
||||
|
|
|
@ -42,7 +42,8 @@ cp $srcdir/var-include-sub.conf $tmpdir/../
|
|||
touch $tmpdir/servers/www.example.org/pages/image.jpg \
|
||||
$tmpdir/servers/www.example.org/pages/image.JPG \
|
||||
$tmpdir/servers/www.example.org/pages/Foo.txt \
|
||||
$tmpdir/servers/www.example.org/pages/a
|
||||
$tmpdir/servers/www.example.org/pages/a
|
||||
echo "12345" > $tmpdir/servers/www.example.org/pages/range.pdf
|
||||
|
||||
printf "%-40s" "preparing infrastructure"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ BEGIN {
|
|||
|
||||
use strict;
|
||||
use IO::Socket;
|
||||
use Test::More tests => 28;
|
||||
use Test::More tests => 29;
|
||||
use LightyTest;
|
||||
|
||||
my $tf = LightyTest->new();
|
||||
|
@ -292,6 +292,14 @@ EOF
|
|||
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
|
||||
ok($tf->handle_http($t) == 0, 'Duplicate If-Modified-Since headers');
|
||||
|
||||
$t->{REQUEST} = ( <<EOF
|
||||
GET /range.pdf HTTP/1.0
|
||||
Range: bytes=0-
|
||||
EOF
|
||||
);
|
||||
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
|
||||
ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled');
|
||||
|
||||
|
||||
|
||||
ok($tf->stop_proc == 0, "Stopping lighttpd");
|
||||
|
|
Loading…
Reference in New Issue