perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1448205 - /perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm
Date Wed, 20 Feb 2013 15:01:01 GMT
Author: jkaluza
Date: Wed Feb 20 15:01:00 2013
New Revision: 1448205

URL: http://svn.apache.org/r1448205
Log:
* t/hooks/TestHooks/authen_basic.pm: Do not check for ap_requires, it is
  not needed in httpd-2.4, because authz provider checks for the valid-user.


Modified:
    perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm

Modified: perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm?rev=1448205&r1=1448204&r2=1448205&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm (original)
+++ perl/modperl/branches/httpd24/t/hooks/TestHooks/authen_basic.pm Wed Feb 20 15:01:00 2013
@@ -3,9 +3,13 @@ package TestHooks::authen_basic;
 use strict;
 use warnings FATAL => 'all';
 
+use Apache::Test;
+use Apache::TestUtil;
+
 use Apache2::Access ();
 
 use Apache2::Const -compile => qw(OK HTTP_UNAUTHORIZED SERVER_ERROR);
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my $r = shift;
@@ -16,9 +20,13 @@ sub handler {
 
     my $user = $r->user;
 
-    my $requirement = $r->requires->[0]->{requirement};
-
-    return Apache2::Const::SERVER_ERROR unless $requirement eq 'valid-user';
+    # We don't have to check for valid-user in 2.4.0+. If there is bug
+    # in require valid-user handling, it will result in failed test with
+    # bad username/password.
+    if (!APACHE24) {
+        my $requirement = $r->requires->[0]->{requirement};
+        return Apache2::Const::SERVER_ERROR unless $requirement eq 'valid-user';
+    }
 
     unless ($user eq 'dougm' and $sent_pw eq 'foo') {
         $r->note_basic_auth_failure;



Mime
View raw message