[config] config options to stream request/response (#949, #376)
[lighttpd.git] / tests / mod-access.t
blob58c01ac72428edd8f4758b7aef8c4372838fcc45
1 #!/usr/bin/env perl
2 BEGIN {
3 # add current source dir to the include-path
4 # we need this for make distcheck
5 (my $srcdir = $0) =~ s,/[^/]+$,/,;
6 unshift @INC, $srcdir;
9 use strict;
10 use IO::Socket;
11 use Test::More tests => 4;
12 use LightyTest;
14 my $tf = LightyTest->new();
15 my $t;
17 ok($tf->start_proc == 0, "Starting lighttpd") or die();
19 $t->{REQUEST} = ( <<EOF
20 GET /index.html~ HTTP/1.0
21 EOF
23 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
24 ok($tf->handle_http($t) == 0, 'forbid access to ...~');
26 $t->{REQUEST} = ( <<EOF
27 GET /index.html~/ HTTP/1.0
28 EOF
30 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
31 ok($tf->handle_http($t) == 0, '#1230 - forbid access to ...~ - trailing slash');
33 ok($tf->stop_proc == 0, "Stopping lighttpd");