summaryrefslogtreecommitdiff
path: root/tests/core-condition.t
diff options
context:
space:
mode:
authormOo <moo.lighttpd@gmail.com>2005-09-29 14:42:35 +0000
committermOo <moo.lighttpd@gmail.com>2005-09-29 14:42:35 +0000
commit9be1abfb85fb7b572c36ab62bdb904a9f2e4799b (patch)
treef905a00757b90e635c272e1edb305b1d5c23ecdf /tests/core-condition.t
parent33320eba678d9dcf1a97d8e7ed25798e849a6afd (diff)
downloadlighttpd1.4-9be1abfb85fb7b572c36ab62bdb904a9f2e4799b.tar.gz
lighttpd1.4-9be1abfb85fb7b572c36ab62bdb904a9f2e4799b.zip
an unset header is now treat as empty_string "" to make the conditional logic correct.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@757 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/core-condition.t')
-rwxr-xr-xtests/core-condition.t15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/core-condition.t b/tests/core-condition.t
index 13b33df2..96b05d87 100755
--- a/tests/core-condition.t
+++ b/tests/core-condition.t
@@ -110,27 +110,30 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 403 }, { '
ok($tf->handle_http($t) == 0, 'remote ip cache (#255)');
$t->{REQUEST} = ( <<EOF
-GET /empty-ref.jpg HTTP/1.0
+GET /empty-ref.noref HTTP/1.0
+Cookie: empty-ref
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: is no set');
+ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is no set');
$t->{REQUEST} = ( <<EOF
-GET /empty-ref.jpg HTTP/1.0
+GET /empty-ref.noref HTTP/1.0
+Cookie: empty-ref
Referer:
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ];
-ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: is no set');
+ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is empty');
$t->{REQUEST} = ( <<EOF
-GET /empty-ref.jpg HTTP/1.0
+GET /empty-ref.noref HTTP/1.0
+Cookie: empty-ref
Referer: foobar
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: is no set');
+ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: foobar');
ok($tf->stop_proc == 0, "Stopping lighttpd");