~ubuntu-branches/ubuntu/hardy/lighttpd/hardy

« back to all changes in this revision

Viewing changes to tests/mod-redirect.t

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-09-12 14:02:31 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070912140231-g5w19l8wbtywlcgd
Tags: 1.4.18-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Update maintainer field in debian/control.
  - Build against libgamin-dev rather than libfam-dev (fixes a warning
    during startup)
  - Make sure that upgrades succeed, even if we can't restart lighttpd.
  - Clean environment in init.d script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
use strict;
10
10
use IO::Socket;
11
 
use Test::More tests => 6;
 
11
use Test::More tests => 7;
12
12
use LightyTest;
13
13
 
14
14
my $tf = LightyTest->new();
24
24
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/' } ];
25
25
ok($tf->handle_http($t) == 0, 'external redirect');
26
26
 
 
27
$t->{REQUEST}  = ( <<EOF
 
28
GET /redirect/ HTTP/1.0
 
29
Host: vvv.example.org
 
30
EOF
 
31
 );
 
32
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/', 'Content-Length' => '0' } ];
 
33
ok($tf->handle_http($t) == 0, 'external redirect should have a Content-Length: 0');
 
34
 
27
35
$t->{REQUEST} = ( <<EOF
28
36
GET /redirect/ HTTP/1.0
29
37
Host: zzz.example.org