|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
# returning 200 |
|
|
|
|
# returning 302 + Location |
|
|
|
|
# returning 404 |
|
|
|
|
# returning no status -> 200 |
|
|
|
|
# |
|
|
|
|
BEGIN { |
|
|
|
|
# add current source dir to the include-path |
|
|
|
@ -17,7 +18,7 @@ BEGIN {
|
|
|
|
|
|
|
|
|
|
use strict; |
|
|
|
|
use IO::Socket; |
|
|
|
|
use Test::More tests => 6; |
|
|
|
|
use Test::More tests => 8; |
|
|
|
|
use LightyTest; |
|
|
|
|
|
|
|
|
|
my $tf = LightyTest->new(); |
|
|
|
@ -57,5 +58,19 @@ EOF
|
|
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "Not found here\n" } ]; |
|
|
|
|
ok($tf->handle_http($t) == 0, '404 handler => dynamic(404)'); |
|
|
|
|
|
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
GET /dynamic/nostatus/notfound HTTP/1.0 |
|
|
|
|
EOF |
|
|
|
|
); |
|
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "found here\n" } ]; |
|
|
|
|
ok($tf->handle_http($t) == 0, '404 handler => dynamic(nostatus)'); |
|
|
|
|
|
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
GET /send404.pl HTTP/1.0 |
|
|
|
|
EOF |
|
|
|
|
); |
|
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; |
|
|
|
|
ok($tf->handle_http($t) == 0, '404 generated by CGI should stay 404'); |
|
|
|
|
|
|
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd"); |
|
|
|
|
|
|
|
|
|