2005-09-01 11:44:57 +00:00
|
|
|
#!/usr/bin/env perl
|
2005-06-26 10:27:41 +00:00
|
|
|
BEGIN {
|
|
|
|
# add current source dir to the include-path
|
|
|
|
# we need this for make distcheck
|
|
|
|
(my $srcdir = $0) =~ s#/[^/]+$#/#;
|
|
|
|
unshift @INC, $srcdir;
|
|
|
|
}
|
2005-03-02 11:27:02 +00:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use IO::Socket;
|
|
|
|
use Test::More tests => 3;
|
2005-06-15 09:37:18 +00:00
|
|
|
use LightyTest;
|
2005-03-02 11:27:02 +00:00
|
|
|
|
2005-06-15 09:37:18 +00:00
|
|
|
my $tf = LightyTest->new();
|
|
|
|
my $t;
|
2005-03-02 11:27:02 +00:00
|
|
|
|
2005-06-15 09:37:18 +00:00
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd") or die();
|
2005-03-02 11:27:02 +00:00
|
|
|
|
2005-06-15 09:37:18 +00:00
|
|
|
$t->{REQUEST} = ( <<EOF
|
2005-03-02 11:27:02 +00:00
|
|
|
GET /index.html~ HTTP/1.0
|
|
|
|
EOF
|
|
|
|
);
|
2005-08-31 12:55:44 +00:00
|
|
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
|
2005-06-15 09:37:18 +00:00
|
|
|
ok($tf->handle_http($t) == 0, 'forbid access to ...~');
|
2005-03-02 11:27:02 +00:00
|
|
|
|
2005-06-15 09:37:18 +00:00
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd");
|
2005-03-02 11:27:02 +00:00
|
|
|
|