- added test for the location crash

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1887 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.17
Marcus Rückert 15 years ago
parent 8f9f532083
commit 01fab66c18
  1. 4
      tests/docroot/www/crlfcrash.pl
  2. 9
      tests/mod-cgi.t

@ -0,0 +1,4 @@
#!/usr/bin/perl
#
print "Location: http://www.example.org/\r\n\n\n";
exit;

@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
use Test::More tests => 15;
use Test::More tests => 16;
use LightyTest;
my $tf = LightyTest->new();
@ -115,6 +115,13 @@ EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Content-Length' => '' } ];
ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST');
# broken header crash
$t->{REQUEST} = ( <<EOF
GET /crlfcrash.pl HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 500 } ];
ok($tf->handle_http($t) == 0, 'broken header via perl cgi');
ok($tf->stop_proc == 0, "Stopping lighttpd");

Loading…
Cancel
Save