jorton 2004/10/24 14:04:39
Modified: perl-framework/t/modules rewrite.t
perl-framework/t/conf extra.conf.in
Log:
Test RewriteCond on QUERY_STRING.
Revision Changes Path
1.14 +10 -2 httpd-test/perl-framework/t/modules/rewrite.t
Index: rewrite.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -d -w -u -r1.13 -r1.14
--- rewrite.t 24 Oct 2004 20:50:09 -0000 1.13
+++ rewrite.t 24 Oct 2004 21:04:39 -0000 1.14
@@ -14,7 +14,7 @@
my @url = qw(forbidden gone perm temp);
my $r;
-plan tests => @map * @num + 5, need_module 'rewrite';
+plan tests => @map * @num + 7, need_module 'rewrite';
foreach (@map) {
foreach my $n (@num) {
@@ -66,6 +66,14 @@
$r = GET_BODY("/modules/rewrite/proxy2/env.pl?fish=fowl");
chomp $r;
ok t_cmp($r, qr/QUERY_STRING = fish=fowl\n/s, "QUERY_STRING passed OK");
+
+ ok t_cmp(GET_RC("/modules/rewrite/proxy3/env.pl?horse=norman"), 404,
+ "RewriteCond QUERY_STRING test");
+
+ $r = GET_BODY("/modules/rewrite/proxy3/env.pl?horse=trigger");
+ chomp $r;
+ ok t_cmp($r, qr/QUERY_STRING = horse=trigger\n/s, "QUERY_STRING passed
OK");
+
} else {
- skip "Skipping rewrite QUERY_STRING test; missing proxy or CGI module";
+ skip "Skipping rewrite QUERY_STRING test; missing proxy or CGI module"
foreach (1..3);
}
1.57 +4 -0 httpd-test/perl-framework/t/conf/extra.conf.in
Index: extra.conf.in
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/conf/extra.conf.in,v
retrieving revision 1.56
retrieving revision 1.57
diff -d -w -u -r1.56 -r1.57
--- extra.conf.in 24 Oct 2004 20:45:37 -0000 1.56
+++ extra.conf.in 24 Oct 2004 21:04:39 -0000 1.57
@@ -188,6 +188,10 @@
### Proxy pass-through to env.pl
RewriteRule ^/modules/rewrite/proxy2/(.*)$
http://@SERVERNAME@:@PORT@/modules/cgi/$1 [L,P]
+
+ ### Pass-through conditional on QUERY_STRING
+ RewriteCond %{QUERY_STRING} horse=trigger
+ RewriteRule ^/modules/rewrite/proxy3/(.*)$
http://@SERVERNAME@:@PORT@/modules/cgi/$1 [L,P]
</IfModule>