summaryrefslogtreecommitdiff
path: root/tests/core-request.t
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-10-02 21:50:51 +0000
committerJan Kneschke <jan@kneschke.de>2005-10-02 21:50:51 +0000
commitac7db634f6d7b8ab3c7fb20f7cf7dec60119a037 (patch)
treea92297fa3358694ab9a382e23f1a1175e0143618 /tests/core-request.t
parentef8f508a5fe949e9b9a3f1b9f8d20d7e585dede1 (diff)
downloadlighttpd1.4-ac7db634f6d7b8ab3c7fb20f7cf7dec60119a037.tar.gz
lighttpd1.4-ac7db634f6d7b8ab3c7fb20f7cf7dec60119a037.zip
detect empty URIs in requests as bad request, status 400
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@773 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/core-request.t')
-rwxr-xr-xtests/core-request.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/core-request.t b/tests/core-request.t
index f6a486aa..f4db9376 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 => 31;
+use Test::More tests => 33;
use LightyTest;
my $tf = LightyTest->new();
@@ -259,6 +259,20 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'application/octet-stream' } ];
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');
+
ok($tf->stop_proc == 0, "Stopping lighttpd");