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 2005/12/16 17:15:40 UTC

svn commit: r357178 - in /httpd/test/trunk/perl-framework/t: apache/pr18757.t htdocs/modules/cgi/ htdocs/modules/cgi/empty.pl.PL

Author: jorton
Date: Fri Dec 16 08:15:33 2005
New Revision: 357178

URL: http://svn.apache.org/viewcvs?rev=357178&view=rev
Log:
- add regression test for PR 18757

Added:
    httpd/test/trunk/perl-framework/t/apache/pr18757.t
    httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/empty.pl.PL
Modified:
    httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/   (props changed)

Added: httpd/test/trunk/perl-framework/t/apache/pr18757.t
URL: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/apache/pr18757.t?rev=357178&view=auto
==============================================================================
--- httpd/test/trunk/perl-framework/t/apache/pr18757.t (added)
+++ httpd/test/trunk/perl-framework/t/apache/pr18757.t Fri Dec 16 08:15:33 2005
@@ -0,0 +1,43 @@
+#
+# Regression test for PR 18757.
+#
+# Annoyingly awkward to write because LWP is a poor excuse for an HTTP
+# interface and will lie about what response headers are sent, so this
+# must be yet another test which speaks TCP directly.
+#
+
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+use Apache::TestRequest;
+
+plan tests => 2, need 'cgi', 'proxy', need_min_apache_version('2.2.1');
+
+my $sock = Apache::TestRequest::vhost_socket("proxy_http_https");
+
+my $url = Apache::TestRequest::resolve_url("/modules/cgi/empty.pl");
+
+t_debug "URL via proxy is $url";
+
+ok $sock;
+
+$sock->print("HEAD $url HTTP/1.0\r\n");
+$sock->print("\r\n");
+
+my $ok = 0;
+my $response;
+
+do {
+    chomp($response = Apache::TestRequest::getline($sock) || '');
+    $response =~ s/\s$//;
+    
+    if ($response =~ /Content-Length: 0/) {
+        $ok = 1;
+    }
+
+}
+while ($response ne "");
+
+ok t_cmp($ok, 1, "whether proxy strips Content-Length header");

Propchange: httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 16 08:15:33 2005
@@ -13,3 +13,4 @@
 big.pl
 not-modified.pl
 nph-102.pl
+empty.pl

Added: httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/empty.pl.PL
URL: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/empty.pl.PL?rev=357178&view=auto
==============================================================================
--- httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/empty.pl.PL (added)
+++ httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/empty.pl.PL Fri Dec 16 08:15:33 2005
@@ -0,0 +1,6 @@
+use strict;
+
+print "Content-type: text/plain\r\n";
+print "Content-Length: 0\r\n";
+print "\r\n";
+