You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jc...@apache.org on 2016/12/12 18:56:20 UTC
svn commit: r1773855 - in /httpd/test/framework/trunk/t:
apache/http_strict.t conf/extra.conf.in
Author: jchampion
Date: Mon Dec 12 18:56:20 2016
New Revision: 1773855
URL: http://svn.apache.org/viewvc?rev=1773855&view=rev
Log:
Add regression test for strict recursion loop
Modified:
httpd/test/framework/trunk/t/apache/http_strict.t
httpd/test/framework/trunk/t/conf/extra.conf.in
Modified: httpd/test/framework/trunk/t/apache/http_strict.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/http_strict.t?rev=1773855&r1=1773854&r2=1773855&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/http_strict.t (original)
+++ httpd/test/framework/trunk/t/apache/http_strict.t Mon Dec 12 18:56:20 2016
@@ -103,6 +103,11 @@ my @test_cases = (
[ "R" . "Foo: b\tar" => 200 ],
[ "R" . "Foo: b\x01ar" => 500 ],
+ #
+ # implementation regression tests
+ #
+ # `Header always set <bad value>` should not cause a recursion loop
+ [ "GET /regression-header HTTP/1.1\r\nHost: localhost\r\n\r\n" => 500, have_module qw(mod_headers) ],
);
plan tests => scalar(@test_cases),
@@ -112,6 +117,7 @@ plan tests => scalar(@test_cases),
foreach my $t (@test_cases) {
my $req = $t->[0];
my $expect = $t->[1];
+ my $cond = $t->[2];
my $decoded;
if ($req =~ s/^R//) {
@@ -121,6 +127,12 @@ foreach my $t (@test_cases) {
$req = "GET /apache/http_strict/send_hdr.pl?$q HTTP/1.0\r\n\r\n";
}
+ if (defined $cond && not $cond) {
+ $req = escape($req);
+ print "# SKIPPING:\n# $req\n";
+ skip "Test prerequisites are not met";
+ next;
+ }
my $sock = Apache::TestRequest::vhost_socket("http_strict");
if (!$sock) {
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=1773855&r1=1773854&r2=1773855&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Mon Dec 12 18:56:20 2016
@@ -975,6 +975,12 @@ LimitRequestFields 32
Options +ExecCGI
AddHandler cgi-script .pl
</Directory>
+ <IfModule mod_headers.c>
+ <Location /regression-header>
+ # Note the vertical tab (^K or 0x0B) embedded in the header value
+ Header always set X-Bad "verticaltab"
+ </Location>
+ </IfModule>
</VirtualHost>
</IfVersion>
</IfDefine>