You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by el...@apache.org on 2017/09/26 13:20:06 UTC
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
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 @@
</Directory>
+ # 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");
+}
+