Skip to content

Commit 2e15c19

Browse files
author
Jan Kaluža
committed
* 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. git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/branches/httpd24@1448205 13f79535-47bb-0310-9956-ffa450edef68
1 parent 31d7c63 commit 2e15c19

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

t/hooks/TestHooks/authen_basic.pm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ package TestHooks::authen_basic;
33
use strict;
44
use warnings FATAL => 'all';
55

6+
use Apache::Test;
7+
use Apache::TestUtil;
8+
69
use Apache2::Access ();
710

811
use Apache2::Const -compile => qw(OK HTTP_UNAUTHORIZED SERVER_ERROR);
12+
use constant APACHE24 => have_min_apache_version('2.4.0');
913

1014
sub 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;

0 commit comments

Comments
 (0)