Subject: | PATCH: Fixes header parsing problem in ModPerl::PerlRun and ModPerl::Registry scripts |
Applying the 1-line patch below to the header() method, fixes a problem
I often have in ModPerl::PerlRun and ModPerl::Registry scripts where my
Status headers aren't being parsed and converted into the appropriate
HTTP status codes even though PerlOptions +ParseHeaders is set. I
disabled the use of send_cgi_header() for mod_perl > 1. See also http://
perl.apache.org/docs/2.0/api/Apache2/Response.html#C_send_cgi_header_
======= START OF PATCH ========
--- CGI.pm.old Sat Feb 24 00:03:16 2007
+++ CGI.pm Tue Mar 6 19:46:52 2007
@@ -1524,7 +1524,7 @@
push(@header,map {ucfirst $_} @other);
push(@header,"Content-Type: $type") if $type ne '';
my $header = join($CRLF,@header)."${CRLF}${CRLF}";
- if ($MOD_PERL and not $nph) {
+ if (($MOD_PERL == 1) && !$nph) {
$self->r->send_cgi_header($header);
return '';
}
======= END OF PATCH ========
B.t.w. if needed, this is the check for the PerlOption ParseHeaders:
$self->r->is_perl_option_enabled('ParseHeaders')