You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by jo...@apache.org on 2004/11/27 16:14:18 UTC
svn commit: r106719 - /httpd/test/trunk/perl-framework/t/conf/extra.conf.in /httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/not-modified.pl.PL /httpd/test/trunk/perl-framework/t/modules/deflate.t
Author: jorton
Date: Sat Nov 27 07:14:17 2004
New Revision: 106719
URL: http://svn.apache.org/viewcvs?view=rev&rev=106719
Log:
Add tests case for bug in mod_deflate 304 handling.
Added:
httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/not-modified.pl.PL
Modified:
httpd/test/trunk/perl-framework/t/conf/extra.conf.in
httpd/test/trunk/perl-framework/t/modules/deflate.t
Modified: httpd/test/trunk/perl-framework/t/conf/extra.conf.in
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/conf/extra.conf.in?view=diff&rev=106719&p1=httpd/test/trunk/perl-framework/t/conf/extra.conf.in&r1=106718&p2=httpd/test/trunk/perl-framework/t/conf/extra.conf.in&r2=106719
==============================================================================
--- httpd/test/trunk/perl-framework/t/conf/extra.conf.in (original)
+++ httpd/test/trunk/perl-framework/t/conf/extra.conf.in Sat Nov 27 07:14:17 2004
@@ -409,6 +409,10 @@
SetOutputFilter DEFLATE
</Directory>
+ <Location /modules/cgi/not-modified.pl>
+ SetOutputFilter DEFLATE
+ </Location>
+
<Location /modules/deflate/echo_post>
SetInputFilter DEFLATE
SetHandler echo_post
Added: httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/not-modified.pl.PL
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/not-modified.pl.PL?view=auto&rev=106719
==============================================================================
--- (empty file)
+++ httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/not-modified.pl.PL Sat Nov 27 07:14:17 2004
@@ -0,0 +1,4 @@
+use strict;
+
+print "Status: 304 Not Modified\r\n\r\n";
+
Modified: httpd/test/trunk/perl-framework/t/modules/deflate.t
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/modules/deflate.t?view=diff&rev=106719&p1=httpd/test/trunk/perl-framework/t/modules/deflate.t&r1=106718&p2=httpd/test/trunk/perl-framework/t/modules/deflate.t&r2=106719
==============================================================================
--- httpd/test/trunk/perl-framework/t/modules/deflate.t (original)
+++ httpd/test/trunk/perl-framework/t/modules/deflate.t Sat Nov 27 07:14:17 2004
@@ -12,7 +12,8 @@
);
my $server_inflate_uri="/modules/deflate/echo_post";
-my $tests = @server_deflate_uris;
+my $cgi_tests = 3;
+my $tests = @server_deflate_uris + $cgi_tests;
my $vars = Apache::Test::vars();
my $module = 'default';
@@ -35,4 +36,34 @@
content => $deflated_str);
ok $original_str eq $inflated_str;
+}
+
+if (have_module('cgi')) {
+ my $sock = Apache::TestRequest::vhost_socket('default');
+
+ ok $sock;
+
+ Apache::TestRequest::socket_trace($sock);
+
+ $sock->print("GET /modules/cgi/not-modified.pl HTTP/1.0\r\n");
+ $sock->print("Accept-Encoding: gzip\r\n");
+ $sock->print("\r\n");
+
+ # Read the status line
+ chomp(my $response = Apache::TestRequest::getline($sock) || '');
+ $response =~ s/\s$//;
+
+ ok t_cmp($response, qr{HTTP/1\.. 304}, "response was 304");
+
+ do {
+ chomp($response = Apache::TestRequest::getline($sock) || '');
+ $response =~ s/\s$//;
+ }
+ while ($response ne "");
+
+ # now try and read any body: should return 0, EOF.
+ my $ret = $sock->read($response, 1024);
+ ok t_cmp($ret, 0, "expect EOF after 304 header");
+} else {
+ skip "skipping 304/deflate tests without mod_cgi" foreach (1..$cgi_tests);
}