httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1782318 - in /httpd/test/framework/trunk/t: conf/extra.conf.in modules/proxy.t
Date Thu, 09 Feb 2017 12:37:48 GMT
Author: jorton
Date: Thu Feb  9 12:37:48 2017
New Revision: 1782318

URL: http://svn.apache.org/viewvc?rev=1782318&view=rev
Log:
Add regression test for no-proxy.

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

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1782318&r1=1782317&r2=1782318&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Thu Feb  9 12:37:48 2017
@@ -282,6 +282,9 @@
       <Location /reverse/locproxy/>
          ProxyPass http://@SERVERNAME@:@PORT@/
       </Location>
+      <IfModule mod_setenvif.c>
+          SetEnvIf Request_URI "^/reverse/locproxy/index.html$" no-proxy
+      </IfModule>
    </VirtualHost>
 
    <IfVersion >= 2.2.5>

Modified: httpd/test/framework/trunk/t/modules/proxy.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/proxy.t?rev=1782318&r1=1782317&r2=1782318&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/proxy.t (original)
+++ httpd/test/framework/trunk/t/modules/proxy.t Thu Feb  9 12:37:48 2017
@@ -6,11 +6,11 @@ use Apache::TestRequest;
 use Apache::TestUtil;
 use Apache::TestConfig ();
 
-my $num_tests = 19;
+my $num_tests = 20;
 if (have_min_apache_version('2.4.7')) {
     $num_tests++;
 }
-plan tests => $num_tests, need_module 'proxy';
+plan tests => $num_tests, need need_module 'proxy', need_module 'setenvif';
 
 Apache::TestRequest::module("proxy_http_reverse");
 Apache::TestRequest::user_agent(requests_redirectable => 0);
@@ -23,6 +23,15 @@ $r = GET("/reverse/locproxy/");
 ok t_cmp($r->code, 200, "reverse Location-proxy to index.html");
 ok t_cmp($r->content, qr/^welcome to /, "reverse Location-proxied body");
 
+if (have_min_apache_version('2.4.26')) {
+    # This location should get trapped by the SetEnvIf and NOT be
+    # proxied, hence should get a 404.
+    $r = GET("/reverse/locproxy/index.html");
+    ok t_cmp($r->code, 404, "reverse Location-proxy blocked by no-proxy env");
+} else {
+    skip "skipping no-proxy test with httpd <2.4.26";
+}
+
 if (have_cgi) {
     $r = GET("/reverse/modules/cgi/env.pl");
     ok t_cmp($r->code, 200, "reverse proxy to env.pl");



Mime
View raw message