summaryrefslogtreecommitdiff
path: root/tests/mod-compress.t
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-10-04 09:25:29 +0000
committerJan Kneschke <jan@kneschke.de>2005-10-04 09:25:29 +0000
commit51d6e2abf0822bd4d9dac09c16b2cece26d65653 (patch)
tree4294f56ab6557648598ed065fbbc24077bb07bb4 /tests/mod-compress.t
parent6cfb2582c409eacc5ec731568081e41853e3448a (diff)
downloadlighttpd1.4-51d6e2abf0822bd4d9dac09c16b2cece26d65653.tar.gz
lighttpd1.4-51d6e2abf0822bd4d9dac09c16b2cece26d65653.zip
fixed output of non-cached compressed content and added test-cases
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@779 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/mod-compress.t')
-rwxr-xr-xtests/mod-compress.t26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/mod-compress.t b/tests/mod-compress.t
index 5da77f91..3f1462ab 100755
--- a/tests/mod-compress.t
+++ b/tests/mod-compress.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 7;
+use Test::More tests => 9;
use LightyTest;
my $tf = LightyTest->new();
@@ -27,6 +27,16 @@ ok($tf->handle_http($t) == 0, 'Vary is set');
$t->{REQUEST} = ( <<EOF
GET /index.html HTTP/1.0
Accept-Encoding: deflate
+Host: no-cache.example.org
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } ];
+ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is set');
+
+$t->{REQUEST} = ( <<EOF
+GET /index.html HTTP/1.0
+Accept-Encoding: deflate
+Host: cache.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } ];
@@ -35,12 +45,23 @@ ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is
$t->{REQUEST} = ( <<EOF
GET /index.html HTTP/1.0
Accept-Encoding: gzip
+Host: no-cache.example.org
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } ];
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1306', '+Content-Encoding' => '' } ];
ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set');
$t->{REQUEST} = ( <<EOF
+GET /index.html HTTP/1.0
+Accept-Encoding: gzip
+Host: cache.example.org
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1306', '+Content-Encoding' => '' } ];
+ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set');
+
+
+$t->{REQUEST} = ( <<EOF
GET /index.txt HTTP/1.0
Accept-Encoding: gzip, deflate
EOF
@@ -56,5 +77,4 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '', 'Content-Type' => "text/plain" } ];
ok($tf->handle_http($t) == 0, 'Content-Type is from the original file');
-
ok($tf->stop_proc == 0, "Stopping lighttpd");