File: mod-access.t

package info (click to toggle)
lighttpd 1.4.13-4etch12
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,480 kB
  • ctags: 3,537
  • sloc: ansic: 37,630; sh: 8,915; perl: 2,215; yacc: 584; makefile: 374; php: 9
file content (34 lines) | stat: -rwxr-xr-x 808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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;
}

use strict;
use IO::Socket;
use Test::More tests => 4;
use LightyTest;

my $tf = LightyTest->new();
my $t;

ok($tf->start_proc == 0, "Starting lighttpd") or die();

$t->{REQUEST}  = ( <<EOF
GET /index.html~ HTTP/1.0
EOF
 );
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
ok($tf->handle_http($t) == 0, 'forbid access to ...~');

$t->{REQUEST}  = ( <<EOF
GET /index.html~/ HTTP/1.0
EOF
 );
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
ok($tf->handle_http($t) == 0, '#1230 - forbid access to ...~ - trailing slash');

ok($tf->stop_proc == 0, "Stopping lighttpd");