From 01fab66c183df7884b98ace630c45523f4f18236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= Date: Sun, 12 Aug 2007 17:52:03 +0000 Subject: [PATCH] - 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 --- tests/docroot/www/crlfcrash.pl | 4 ++++ tests/mod-cgi.t | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/docroot/www/crlfcrash.pl 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");