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 78B4C200D0E for ; Tue, 26 Sep 2017 15:20:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7747E1609C1; Tue, 26 Sep 2017 13:20:13 +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 BDB6C1609B4 for ; Tue, 26 Sep 2017 15:20:12 +0200 (CEST) Received: (qmail 91158 invoked by uid 500); 26 Sep 2017 13:20:06 -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 91149 invoked by uid 99); 26 Sep 2017 13:20:06 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 13:20:06 +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 27E173A0167 for ; Tue, 26 Sep 2017 13:20:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1809743 - in /httpd/test/framework/trunk/t: conf/extra.conf.in htdocs/modules/rewrite/vary1.html htdocs/modules/rewrite/vary2.html modules/rewrite.t Date: Tue, 26 Sep 2017 13:20:06 -0000 To: cvs@httpd.apache.org From: elukey@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170926132006.27E173A0167@svn01-us-west.apache.org> archived-at: Tue, 26 Sep 2017 13:20:13 -0000 Author: elukey Date: Tue Sep 26 13:20:05 2017 New Revision: 1809743 URL: http://svn.apache.org/viewvc?rev=1809743&view=rev Log: Add tests for PR 58231 (fix in trunk only) Added: httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary1.html httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary2.html Modified: httpd/test/framework/trunk/t/conf/extra.conf.in httpd/test/framework/trunk/t/modules/rewrite.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=1809743&r1=1809742&r2=1809743&view=diff ============================================================================== --- httpd/test/framework/trunk/t/conf/extra.conf.in (original) +++ httpd/test/framework/trunk/t/conf/extra.conf.in Tue Sep 26 13:20:05 2017 @@ -248,6 +248,14 @@ + # PR 58231: Vary:Host header mistakenly added to the response + RewriteCond "%{HTTP_HOST} = 'test1'" + RewriteRule /modules/rewrite/vary1.html /modules/rewrite/vary2.html [L] + + RewriteCond "%{HTTP:Host} = 'test2'" + RewriteRule /modules/rewrite/vary1.html /modules/rewrite/vary2.html [L] + + ### Proxy pass-through to env.pl RewriteRule ^/modules/rewrite/proxy2/(.*)$ http://@SERVERNAME@:@PORT@/modules/cgi/$1 [L,P] Added: httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary1.html URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary1.html?rev=1809743&view=auto ============================================================================== --- httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary1.html (added) +++ httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary1.html Tue Sep 26 13:20:05 2017 @@ -0,0 +1 @@ +VARY1 Added: httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary2.html URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary2.html?rev=1809743&view=auto ============================================================================== --- httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary2.html (added) +++ httpd/test/framework/trunk/t/htdocs/modules/rewrite/vary2.html Tue Sep 26 13:20:05 2017 @@ -0,0 +1 @@ +VARY2 Modified: httpd/test/framework/trunk/t/modules/rewrite.t URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/rewrite.t?rev=1809743&r1=1809742&r2=1809743&view=diff ============================================================================== --- httpd/test/framework/trunk/t/modules/rewrite.t (original) +++ httpd/test/framework/trunk/t/modules/rewrite.t Tue Sep 26 13:20:05 2017 @@ -24,7 +24,7 @@ if (!have_min_apache_version('2.4')) { push @todo, 24 } -plan tests => @map * @num + 16, todo => \@todo, need_module 'rewrite'; +plan tests => @map * @num + 16 + (have_min_apache_version("2.5") ? 2 : 0), todo => \@todo, need_module 'rewrite'; foreach (@map) { foreach my $n (@num) { @@ -122,3 +122,13 @@ if (have_min_apache_version('2.4')) { } else { skip "Skipping PR 60478 test; requires ap_expr in version 2.4" } + +if (have_min_apache_version("2.5")) { + # PR 58231: Vary:Host header mistakenly added to the response + $r = GET("/modules/rewrite/vary1.html", "Host" => "test1"); + ok t_cmp($r->header("Vary"), qr/(?!.*Host.*)/, "Vary:Host header not added, OK"); + + $r = GET("/modules/rewrite/vary1.html", "Host" => "test2"); + ok t_cmp($r->header("Vary"), qr/(?!.*Host.*)/, "Vary:Host header not added, OK"); +} +