Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0946200C16 for ; Thu, 9 Feb 2017 13:37:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9F391160B50; Thu, 9 Feb 2017 12:37:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E9376160B4C for ; Thu, 9 Feb 2017 13:37:49 +0100 (CET) Received: (qmail 35345 invoked by uid 500); 9 Feb 2017 12:37:49 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 35336 invoked by uid 99); 9 Feb 2017 12:37:49 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2017 12:37:49 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 9C87E3A20C3 for ; Thu, 9 Feb 2017 12:37:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: cvs@httpd.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170209123748.9C87E3A20C3@svn01-us-west.apache.org> archived-at: Thu, 09 Feb 2017 12:37:50 -0000 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 @@ ProxyPass http://@SERVERNAME@:@PORT@/ + + SetEnvIf Request_URI "^/reverse/locproxy/index.html$" no-proxy + = 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");