1#!/usr/bin/env perl 2BEGIN { 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; 7} 8 9use strict; 10use IO::Socket; 11use Test::More tests => 4; 12use LightyTest; 13 14my $tf = LightyTest->new(); 15my $t; 16 17ok($tf->start_proc == 0, "Starting lighttpd") or die(); 18 19$t->{REQUEST} = ( <<EOF 20GET /index.html~ HTTP/1.0 21EOF 22 ); 23$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; 24ok($tf->handle_http($t) == 0, 'forbid access to ...~'); 25 26$t->{REQUEST} = ( <<EOF 27GET /index.html~/ HTTP/1.0 28EOF 29 ); 30$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; 31ok($tf->handle_http($t) == 0, '#1230 - forbid access to ...~ - trailing slash'); 32 33ok($tf->stop_proc == 0, "Stopping lighttpd"); 34 35