summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-04-21 17:23:17 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2018-08-05 03:44:15 -0400
commit1b62dc325c0c1ecba1bb993a4111310cd4c798c7 (patch)
tree1690c969d76a842998f28644a70c6fbc6f6c0938 /tests
parente8c1efd5dfc11b5001113198741536648067c024 (diff)
downloadlighttpd1.4-1b62dc325c0c1ecba1bb993a4111310cd4c798c7.tar.gz
lighttpd1.4-1b62dc325c0c1ecba1bb993a4111310cd4c798c7.zip
[tests] test_request unit tests
unit tests for request processing collect existing request processing tests from Perl tests/*.t (test_request.c runs *much* more quickly than Perl tests/*.t)
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/SConscript1
-rwxr-xr-xtests/core-request.t256
-rwxr-xr-xtests/core.t166
-rw-r--r--tests/meson.build1
-rwxr-xr-xtests/request.t88
6 files changed, 16 insertions, 497 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 37f0d0b0..398c67c3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -30,7 +30,6 @@ CONFS=\
core-request.t \
core-response.t \
core-var-include.t \
- core.t \
fastcgi-10.conf \
fastcgi-13.conf \
fastcgi-auth.conf \
diff --git a/tests/SConscript b/tests/SConscript
index 003a69c4..e542dc1c 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -18,7 +18,6 @@ extra_dist = Split('fastcgi-10.conf \
core-request.t \
core-response.t \
core-keepalive.t \
- core.t \
mod-access.t \
mod-auth.t \
mod-cgi.t \
diff --git a/tests/core-request.t b/tests/core-request.t
index 6cbfb718..6de62f85 100755
--- a/tests/core-request.t
+++ b/tests/core-request.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 38;
+use Test::More tests => 12;
use LightyTest;
my $tf = LightyTest->new();
@@ -16,216 +16,46 @@ my $t;
ok($tf->start_proc == 0, "Starting lighttpd") or die();
-## Low-Level Request-Header Parsing - URI
-
-$t->{REQUEST} = ( <<EOF
-GET /index%2ehtml HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'URL-encoding');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html%00 HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-ok($tf->handle_http($t) == 0, 'URL-encoding, %00');
-
-
-
-## Low-Level Request-Header Parsing - Host
$t->{REQUEST} = ( <<EOF
GET / HTTP/1.0
-Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'hostname');
+ok($tf->handle_http($t) == 0, 'Valid HTTP/1.0 Request') or die();
$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: 127.0.0.1
+OPTIONS * HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'IPv4 address');
+ok($tf->handle_http($t) == 0, 'OPTIONS');
$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: [::1]
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'IPv6 address');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: www.example.org:80
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'hostname + port');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: 127.0.0.1:80
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'IPv4 address + port');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: [::1]:80
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'IPv6 address + port');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: ../123.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'directory traversal');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: .jsdh.sfdg.sdfg.
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'leading and trailing dot');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: jsdh.sfdg.sdfg.
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'trailing dot is ok');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: .jsdh.sfdg.sdfg
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'leading dot');
-
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: jsdh..sfdg.sdfg
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'two dots');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: jsdh.sfdg.sdfg:asd
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'broken port-number');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: jsdh.sfdg.sdfg:-1
+OPTIONS / HTTP/1.1
+Host: www.example.org
+Connection: close
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'negative port-number');
-
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
+ok($tf->handle_http($t) == 0, 'OPTIONS');
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: :80
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'port given but host missing');
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: .jsdh.sfdg.:sdfg.
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'port and host are broken');
+## Low-Level Request-Header Parsing - URI
$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: a.b-c.d123
+GET /index%2ehtml HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'allowed characters in host-name');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: -a.c
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'leading dash');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: .
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'dot only');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: a192.168.2.10:1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'broken IPv4 address - non-digit');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: 192.168.2:1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'broken IPv4 address - too short');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: [::1]' UNION SELECT '/
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'IPv6 address + SQL injection');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: [::1]/../../../
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'IPv6 address + path traversal');
-
-
-
-## Low-Level Request-Header Parsing - Content-Length
-
+ok($tf->handle_http($t) == 0, 'URL-encoding');
$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Content-Length: -2
+GET /index.html%00 HTTP/1.0
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'negative Content-Length');
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
+ok($tf->handle_http($t) == 0, 'URL-encoding, %00');
$t->{REQUEST} = ( <<EOF
POST /12345.txt HTTP/1.0
@@ -236,22 +66,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 413 } ];
ok($tf->handle_http($t) == 0, 'Content-Length > max-request-size');
-$t->{REQUEST} = ( <<EOF
-POST /12345.txt HTTP/1.0
-Host: 123.example.org
-Content-Length:
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 411 } ];
-ok($tf->handle_http($t) == 0, 'Content-Length is empty');
-
-print "\nLow-Level Request-Header Parsing - HTTP/1.1\n";
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.1
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Host missing');
print "\nContent-Type\n";
$t->{REQUEST} = ( <<EOF
@@ -276,51 +90,11 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Conte
ok($tf->handle_http($t) == 0, 'Content-Type - unknown');
$t->{REQUEST} = ( <<EOF
-GET HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'empty request-URI');
-
-$t->{REQUEST} = ( <<EOF
GET /Foo.txt HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'uppercase filenames');
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Location: foo
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Location:
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping - test 2');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-A:
-Location: foobar
- baz
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, '#1232 - duplicate headers with line-wrapping - test 3');
-
-
-
ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/core.t b/tests/core.t
deleted file mode 100755
index b196666a..00000000
--- a/tests/core.t
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s,/[^/]+$,/,;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 21;
-use LightyTest;
-
-my $tf = LightyTest->new();
-my $t;
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Valid HTTP/1.0 Request') or die();
-
-$t->{REQUEST} = ( <<EOF
-GET /
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing Protocol');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/01.01
-Host: foo
-Connection: close
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'zeros in protocol version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/.01
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing major version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/01.
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing minor version');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/a.b
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'strings as version');
-
-$t->{REQUEST} = ( <<EOF
-BC /
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing protocol + unknown method');
-
-$t->{REQUEST} = ( <<EOF
-ABC
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'missing protocol + unknown method + missing URI');
-
-$t->{REQUEST} = ( <<EOF
-ABC / HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 501 } ];
-ok($tf->handle_http($t) == 0, 'unknown method');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.3
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 505 } ];
-ok($tf->handle_http($t) == 0, 'unknown protocol');
-
-$t->{REQUEST} = ( <<EOF
-GET http://www.example.org/ HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'absolute URI');
-
-print "\nLow-Level Request-Header Parsing\n";
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-ABC : foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'whitespace after key');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-ABC a: foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'whitespace with-in key');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-ABC:foo
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'no whitespace');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-ABC:foo
- bc
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'line-folding');
-
-print "\nLow-Level Request-Header Parsing - URI\n";
-$t->{REQUEST} = ( <<EOF
-GET /index%2ehtml HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'URL-encoding');
-
-$t->{REQUEST} = ( <<EOF
-GET /index.html%00 HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-ok($tf->handle_http($t) == 0, 'URL-encoding, %00');
-
-$t->{REQUEST} = ( <<EOF
-OPTIONS * HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'OPTIONS');
-
-$t->{REQUEST} = ( <<EOF
-OPTIONS / HTTP/1.1
-Host: www.example.org
-Connection: close
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'OPTIONS');
-
-
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/meson.build b/tests/meson.build
index 0ac68a68..1ed3624e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -29,7 +29,6 @@ tests = [
'core-request.t',
'core-response.t',
'core-var-include.t',
- 'core.t',
'lowercase.t',
'mod-access.t',
'mod-auth.t',
diff --git a/tests/request.t b/tests/request.t
index fd853bf2..a9fe3f6a 100755
--- a/tests/request.t
+++ b/tests/request.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 60;
+use Test::More tests => 50;
use LightyTest;
my $tf = LightyTest->new();
@@ -56,13 +56,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'application/octet-stream' } ];
ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype application/octet-stream');
-$t->{REQUEST} = ( <<EOF
-POST / HTTP/1.0
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 411 } ];
-ok($tf->handle_http($t) == 0, 'POST request, no Content-Length');
-
$t->{REQUEST} = ( <<EOF
POST / HTTP/1.0
@@ -391,61 +384,6 @@ ok($tf->handle_http($t) == 0, 'larger headers');
$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Host: www.example.org
-Host: 123.example.org
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate Host headers, Bug #25');
-
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Content-Length: 5
-Content-Length: 4
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate Content-Length headers');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Content-Type: 5
-Content-Type: 4
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate Content-Type headers');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Range: bytes=5-6
-Range: bytes=5-9
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate Range headers');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-None-Match: 5
-If-None-Match: 4
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate If-None-Match headers');
-
-$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-If-Modified-Since: 5
-If-Modified-Since: 4
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'Duplicate If-Modified-Since headers');
-
-$t->{REQUEST} = ( <<EOF
GET /range.pdf HTTP/1.0
Range: bytes=0-
EOF
@@ -454,16 +392,6 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled');
$t->{REQUEST} = ( <<EOF
-GET / HTTP/1.0
-Content-Length: 4
-
-1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'GET with Content-Length');
-
-$t->{REQUEST} = ( <<EOF
OPTIONS / HTTP/1.0
Content-Length: 4
@@ -482,16 +410,6 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
ok($tf->handle_http($t) == 0, 'OPTIONS for RTSP');
$t->{REQUEST} = ( <<EOF
-HEAD / HTTP/1.0
-Content-Length: 4
-
-1234
-EOF
- );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'HEAD with Content-Length');
-
-$t->{REQUEST} = ( <<EOF
GET /index.html HTTP/1.0
If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT
@@ -500,10 +418,6 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
ok($tf->handle_http($t) == 0, 'Duplicate If-Mod-Since, with equal timestamps');
-$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: \0\r\n\r\n" );
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ];
-ok($tf->handle_http($t) == 0, 'invalid chars in Header values (bug #1286)');
-
$t->{REQUEST} = ( "GET / HTTP/1.0\r\nIf-Modified-Since: \r\n\r\n" );
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'empty If-Modified-Since');