diff --git a/tests/docroot/www/crlfcrash.pl b/tests/docroot/www/crlfcrash.pl new file mode 100644 index 00000000..e3d96ada --- /dev/null +++ b/tests/docroot/www/crlfcrash.pl @@ -0,0 +1,4 @@ +#!/usr/bin/perl +# +print "Location: http://www.example.org/\r\n\n\n"; +exit; diff --git a/tests/mod-cgi.t b/tests/mod-cgi.t index a42bcd5e..32125419 100755 --- a/tests/mod-cgi.t +++ b/tests/mod-cgi.t @@ -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} = ( <{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");