httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r109337 - /httpd/test/trunk/perl-framework/t/conf/extra.conf.in /httpd/test/trunk/perl-framework/t/modules/proxy.t
Date Wed, 01 Dec 2004 13:10:23 GMT
Author: jorton
Date: Wed Dec  1 05:10:23 2004
New Revision: 109337

URL: http://svn.apache.org/viewcvs?view=rev&rev=109337
Log:
Simple ProxyPass tests.

Added:
   httpd/test/trunk/perl-framework/t/modules/proxy.t
Modified:
   httpd/test/trunk/perl-framework/t/conf/extra.conf.in

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=109337&p1=httpd/test/trunk/perl-framework/t/conf/extra.conf.in&r1=109336&p2=httpd/test/trunk/perl-framework/t/conf/extra.conf.in&r2=109337
==============================================================================
--- httpd/test/trunk/perl-framework/t/conf/extra.conf.in	(original)
+++ httpd/test/trunk/perl-framework/t/conf/extra.conf.in	Wed Dec  1 05:10:23 2004
@@ -185,7 +185,7 @@
         RewriteRule ^proxy.html$ http://@SERVERNAME@:@PORT@/modules/rewrite/lucky13.html
[L,P]
 
         ## Query-string append
-        RewriteRule ^qsa.html$ http://@SERVERNAME@:@PORT@/modules/cgi/env.pl?foo=bar [QSA,L]
+        RewriteRule ^qsa.html$ @SERVERROOT@/htdocs/modules/cgi/env.pl?foo=bar [QSA,L]
 
         ## Proxy and QSA
         RewriteRule ^proxy-qsa.html$ http://@SERVERNAME@:@PORT@/modules/cgi/env.pl?foo=bar
[QSA,L,P]
@@ -199,6 +199,14 @@
     RewriteCond %{QUERY_STRING} horse=trigger
     RewriteRule ^/modules/rewrite/proxy3/(.*)$ http://@SERVERNAME@:@PORT@/modules/cgi/$1
[L,P]
 
+</IfModule>
+
+
+<IfModule mod_proxy.c>
+   <VirtualHost proxy_http_reverse>
+      ProxyPass /reverse/ http://@SERVERNAME@:@PORT@/
+      ProxyPassReverse /reverse/ http://@SERVERNAME@:@PORT@/
+   </VirtualHost>
 </IfModule>
 
 ##

Added: httpd/test/trunk/perl-framework/t/modules/proxy.t
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/modules/proxy.t?view=auto&rev=109337
==============================================================================
--- (empty file)
+++ httpd/test/trunk/perl-framework/t/modules/proxy.t	Wed Dec  1 05:10:23 2004
@@ -0,0 +1,24 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestUtil;
+use Apache::TestConfig ();
+
+plan tests => 6, need_module 'proxy';
+
+Apache::TestRequest::module("proxy_http_reverse");
+
+my $r = GET("/reverse/");
+ok t_cmp($r->code, 200, "reverse proxy to index.html");
+ok t_cmp($r->content, qr/^welcome to /, "reverse proxied body");
+
+$r = GET("/reverse/modules/cgi/env.pl");
+ok t_cmp($r->code, 200, "reverse proxy to env.pl");
+ok t_cmp($r->content, qr/^APACHE_TEST_HOSTNAME = /, "reverse proxied env.pl response");
+
+$r = GET("/reverse/modules/cgi/env.pl?reverse-proxy");
+ok t_cmp($r->code, 200, "reverse proxy with query string");
+ok t_cmp($r->content, qr/QUERY_STRING = reverse-proxy\n/s, "reverse proxied query string
OK");
+

Mime
View raw message