summaryrefslogtreecommitdiff
path: root/tests/run-tests.pl
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-03-01 10:55:47 +0000
committerJan Kneschke <jan@kneschke.de>2005-03-01 10:55:47 +0000
commit0f779ce2f9ed4f658a816ba40884c5384bfd4fce (patch)
treec5af2d9d6a375aa2022728b8bb7e6e5acb6b1c8d /tests/run-tests.pl
parenta6dfdad19f5b56b24ca8fbcf0a15ecd8863fe9bb (diff)
downloadlighttpd-git-0f779ce2f9ed4f658a816ba40884c5384bfd4fce.tar.gz
fixed #25 by setting all duplicates to 400
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@60 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/run-tests.pl')
-rwxr-xr-xtests/run-tests.pl82
1 files changed, 81 insertions, 1 deletions
diff --git a/tests/run-tests.pl b/tests/run-tests.pl
index ea427d4d..66e58236 100755
--- a/tests/run-tests.pl
+++ b/tests/run-tests.pl
@@ -2,7 +2,7 @@
use strict;
use IO::Socket;
-use Test::More tests => 114;
+use Test::More tests => 120;
my $testname;
@@ -510,6 +510,12 @@ EOF
ok(handle_http == 0, 'Host missing');
+
+
+
+
+
+
print "\nLow-Level Response-Header Parsing - Content-Length:\n";
@request = ( <<EOF
GET /12345.html HTTP/1.0
@@ -528,6 +534,14 @@ EOF
ok(handle_http == 0, 'Content-Length for text/plain');
+
+
+
+
+
+
+
+
print "\nLow-Level Response-Header Parsing - Location:\n";
@request = ( <<EOF
GET /dummydir HTTP/1.0
@@ -544,6 +558,16 @@ EOF
ok(handle_http == 0, 'internal redirect in directory + querystring');
+
+
+
+
+
+
+
+
+
+
print "\nBasic Request-Handling\n";
@request = ( <<EOF
GET /foobar HTTP/1.0
@@ -764,6 +788,62 @@ EOF
ok(handle_http == 0, 'larger headers');
+@request = ( <<EOF
+GET / HTTP/1.0
+Host: www.example.org
+Host: 123.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate Host headers, Bug #25');
+
+
+@request = ( <<EOF
+GET / HTTP/1.0
+Content-Length: 5
+Content-Length: 4
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate Content-Length headers');
+
+@request = ( <<EOF
+GET / HTTP/1.0
+Content-Type: 5
+Content-Type: 4
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate Content-Type headers');
+
+@request = ( <<EOF
+GET / HTTP/1.0
+Range: bytes=5-6
+Range: bytes=5-9
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate Range headers');
+
+@request = ( <<EOF
+GET / HTTP/1.0
+If-None-Match: 5
+If-None-Match: 4
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate If-None-Match headers');
+
+@request = ( <<EOF
+GET / HTTP/1.0
+If-Modified-Since: 5
+If-Modified-Since: 4
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } );
+ok(handle_http == 0, 'Duplicate If-Modified-Since headers');
+
+