You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/12/18 18:44:38 UTC

svn commit: r1050685 - in /httpd/test/framework/trunk/t: conf/extra.conf.in modules/aaa.t

Author: sf
Date: Sat Dec 18 17:44:37 2010
New Revision: 1050685

URL: http://svn.apache.org/viewvc?rev=1050685&view=rev
Log:
Add test for AuthzSendForbiddenOnFailure

Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in
    httpd/test/framework/trunk/t/modules/aaa.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=1050685&r1=1050684&r2=1050685&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Sat Dec 18 17:44:37 2010
@@ -565,6 +565,21 @@ LimitRequestFields    32
                 AuthUserFile basic1
            </Location>
         </IfModule>
+        <IfVersion >= 2.3.11>
+          <IfModule mod_auth_basic.c>
+            Alias /authz/fail/401 @DocumentRoot@
+            Alias /authz/fail/403 @DocumentRoot@
+            <Location /authz/fail>
+                Require user foo
+                AuthType Basic
+                AuthName basic1
+                AuthUserFile basic1
+           </Location>
+           <Location /authz/fail/403>
+                AuthzSendForbiddenOnFailure On
+           </Location>
+          </IfModule>
+        </IfVersion>
         <IfModule mod_auth_form.c>
         <IfModule mod_session_cookie.c>
             Alias /authz/form @DocumentRoot@

Modified: httpd/test/framework/trunk/t/modules/aaa.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/aaa.t?rev=1050685&r1=1050684&r2=1050685&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/aaa.t (original)
+++ httpd/test/framework/trunk/t/modules/aaa.t Sat Dec 18 17:44:37 2010
@@ -13,12 +13,12 @@ Apache::TestRequest::user_agent(keep_ali
 
 my @headers = qw(WWW-Authenticate Authentication-Info Location);
 
-my $tests = 0;
 my %do_tests = ( basic  => 11,
                  digest => 11,
                  form   => 16,
                 );
 
+my $tests = 2;	# AuthzSendForbiddenOnFailure tests
 foreach my $t (keys %do_tests) {
     $tests += $do_tests{$t};
 }
@@ -201,6 +201,21 @@ elsif (exists $do_tests{form}) {
     }
 }
 
+#
+# Test AuthzSendForbiddenOnFailure
+#
+if (have_min_apache_version("2.3.11")) {
+    foreach my $want (401, 403) {
+        my $response = GET "/authz/fail/$want",
+                           username => "ubasic",
+                           password => "pbasic";
+        my $got = $response->code;
+        ok($got, $want, "Expected code $want, got $got");
+    }
+}
+else {
+    skip "skipping tests with httpd <2.3.11" foreach (1..2);
+}
 
 #
 # check that none of the authentication related headers exists