stas 2002/12/23 17:51:40
Modified: ModPerl-Registry/lib/ModPerl RegistryCooker.pm
ModPerl-Registry/t/conf extra.conf.in
Added: ModPerl-Registry/t 404.t
ModPerl-Registry/t/cgi-bin 404.pl
Log:
fix the handling of the return status in ModPerl::RegistryCooker,
add a test to verify that
Revision Changes Path
1.1 modperl-2.0/ModPerl-Registry/t/404.t
Index: 404.t
===================================================================
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET_BODY HEAD);
plan tests => 1;
my $url = "/error_document/cannot_be_found";
{
my $response = "Oops, can't find the requested doc";
ok t_cmp(
$response,
GET_BODY($url),
"test ErrorDocument",
);
}
1.1 modperl-2.0/ModPerl-Registry/t/cgi-bin/404.pl
Index: 404.pl
===================================================================
use strict;
use warnings;
my $r = shift;
$r->content_type('text/plain');
print "Oops, can't find the requested doc";
1.24 +2 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
Index: RegistryCooker.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- RegistryCooker.pm 16 Aug 2002 09:01:17 -0000 1.23
+++ RegistryCooker.pm 24 Dec 2002 01:51:40 -0000 1.24
@@ -157,9 +157,9 @@
# handlers shouldn't set $r->status but return it
my $old_status = $self->[REQ]->status;
my $rc = $self->run;
- my $new_status = $self->[REQ]->status($old_status);
+ $self->[REQ]->status($old_status);
- return ($rc != Apache::OK) ? $rc : $new_status;
+ return ($rc != Apache::OK) ? $rc : $self->[STATUS];
}
#########################################################################
1.8 +9 -0 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
Index: extra.conf.in
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- extra.conf.in 15 Aug 2002 16:17:52 -0000 1.7
+++ extra.conf.in 24 Dec 2002 01:51:40 -0000 1.8
@@ -117,3 +117,12 @@
PerlOptions +ParseHeaders
</Location>
+### the 404 test ###
+
+Alias /error_document/ @ServerRoot@/cgi-bin/
+<Location /error_document>
+ ErrorDocument 404 /error_document/404.pl
+ SetHandler perl-script
+ Options +ExecCGI
+ PerlResponseHandler ModPerl::Registry
+</Location>