check that conditionals and simple-vhost work together
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@91 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/release-1.3.13
parent
6b297b3341
commit
b41aa700ab
|
@ -2,7 +2,7 @@
|
|||
|
||||
use strict;
|
||||
use IO::Socket;
|
||||
use Test::More tests => 8;
|
||||
use Test::More tests => 10;
|
||||
|
||||
my $basedir = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'} : '..');
|
||||
my $srcdir = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.');
|
||||
|
@ -207,6 +207,7 @@ EOF
|
|||
ok(handle_http == 0, 'Host missing');
|
||||
|
||||
|
||||
|
||||
## Low-Level Response-Header Parsing - Content-Length
|
||||
|
||||
|
||||
|
@ -229,8 +230,6 @@ ok(handle_http == 0, 'Content-Length for text/plain');
|
|||
|
||||
## Low-Level Response-Header Parsing - Location
|
||||
|
||||
|
||||
|
||||
@request = ( <<EOF
|
||||
GET /dummydir HTTP/1.0
|
||||
EOF
|
||||
|
@ -245,7 +244,23 @@ EOF
|
|||
@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:2048/dummydir/?foo' } );
|
||||
ok(handle_http == 0, 'internal redirect in directory + querystring');
|
||||
|
||||
## simple-vhost
|
||||
|
||||
@request = ( <<EOF
|
||||
GET /12345.txt HTTP/1.0
|
||||
Host: no-simple.example.org
|
||||
EOF
|
||||
);
|
||||
@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' } );
|
||||
ok(handle_http == 0, 'disabling simple-vhost via conditionals');
|
||||
|
||||
@request = ( <<EOF
|
||||
GET /12345.txt HTTP/1.0
|
||||
Host: simple.example.org
|
||||
EOF
|
||||
);
|
||||
@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } );
|
||||
ok(handle_http == 0, 'simple-vhost via conditionals');
|
||||
|
||||
ok(stop_proc == 0, "Stopping lighttpd");
|
||||
|
||||
|
|
|
@ -134,10 +134,6 @@ expire.url = ( "/expire/access" => "access 2 hours",
|
|||
status.status-url = "/server-status"
|
||||
status.config-url = "/server-config"
|
||||
|
||||
simple-vhost.document-root = "pages"
|
||||
simple-vhost.server-root = "/tmp/lighttpd/servers/"
|
||||
simple-vhost.default-host = "www.example.org"
|
||||
|
||||
$HTTP["host"] == "vvv.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/"
|
||||
}
|
||||
|
@ -147,3 +143,14 @@ $HTTP["host"] == "zzz.example.org" {
|
|||
server.name = "zzz.example.org"
|
||||
}
|
||||
|
||||
$HTTP["host"] == "no-simple.example.org" {
|
||||
server.document-root = "/tmp/lighttpd/servers/123.example.org/pages/"
|
||||
server.name = "zzz.example.org"
|
||||
}
|
||||
|
||||
$HTTP["host"] !~ "(no-simple\.example\.org)" {
|
||||
simple-vhost.document-root = "pages"
|
||||
simple-vhost.server-root = "/tmp/lighttpd/servers/"
|
||||
simple-vhost.default-host = "www.example.org"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue