diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:57:42 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:57:42 +0100 |
commit | 47236ea4c1d5601fc6bea1b280d36152ec5ff32b (patch) | |
tree | 89c109c0bef460fa747a3413610034002fac1cb4 /tests/mod-redirect.t | |
parent | dae92c799e85ec3b65f46da6a776e4386bc99d6c (diff) | |
download | lighttpd-47236ea4c1d5601fc6bea1b280d36152ec5ff32b.tar.gz |
Imported Upstream version 1.4.32
Diffstat (limited to 'tests/mod-redirect.t')
-rwxr-xr-x | tests/mod-redirect.t | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/mod-redirect.t b/tests/mod-redirect.t index 666ca80..14669d9 100755 --- a/tests/mod-redirect.t +++ b/tests/mod-redirect.t @@ -1,19 +1,19 @@ #!/usr/bin/env perl BEGIN { - # add current source dir to the include-path - # we need this for make distcheck - (my $srcdir = $0) =~ s#/[^/]+$#/#; - unshift @INC, $srcdir; + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s,/[^/]+$,/,; + unshift @INC, $srcdir; } use strict; use IO::Socket; -use Test::More tests => 6; +use Test::More tests => 7; use LightyTest; my $tf = LightyTest->new(); my $t; - + ok($tf->start_proc == 0, "Starting lighttpd") or die(); $t->{REQUEST} = ( <<EOF @@ -24,6 +24,14 @@ EOF $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/' } ]; ok($tf->handle_http($t) == 0, 'external redirect'); +$t->{REQUEST} = ( <<EOF +GET /redirect/ HTTP/1.0 +Host: vvv.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/', 'Content-Length' => '0' } ]; +ok($tf->handle_http($t) == 0, 'external redirect should have a Content-Length: 0'); + $t->{REQUEST} = ( <<EOF GET /redirect/ HTTP/1.0 Host: zzz.example.org |