File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,13 @@ package TestHooks::authen_basic;
33use  strict;
44use  warnings FATAL  =>  ' all'  ;
55
6+ use  Apache::Test;
7+ use  Apache::TestUtil;
8+ 
69use  Apache2::Access ();
710
811use  Apache2::Const -compile  =>  qw( OK HTTP_UNAUTHORIZED SERVER_ERROR)  ;
12+ use  constant APACHE24    =>  have_min_apache_version(' 2.4.0'  );
913
1014sub  handler  {
1115    my  $r  = shift ;
@@ -16,9 +20,13 @@ sub handler {
1620
1721    my  $user  = $r -> user;
1822
19-     my  $requirement  = $r -> requires-> [0]-> {requirement };
20- 
21-     return  Apache2::Const::SERVER_ERROR unless  $requirement  eq  ' valid-user'  ;
23+     #  We don't have to check for valid-user in 2.4.0+. If there is bug
24+     #  in require valid-user handling, it will result in failed test with
25+     #  bad username/password.
26+     if  (!APACHE24) {
27+         my  $requirement  = $r -> requires-> [0]-> {requirement };
28+         return  Apache2::Const::SERVER_ERROR unless  $requirement  eq  ' valid-user'  ;
29+     }
2230
2331    unless  ($user  eq  ' dougm'   and  $sent_pw  eq  ' foo'  ) {
2432        $r -> note_basic_auth_failure;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments