This is a discussion on Re: status code / constant question - modperl ; Jonathan wrote: > I started supporting 400/403 errors in a mod_perl handler for an API on > my projects > > I ran into this odd little issue: > > With this line: > DEBUG_STATUS && print STDERR ("\n status-> ...
Jonathan wrote:
> I started supporting 400/403 errors in a mod_perl handler for an API on
> my projects
>
> I ran into this odd little issue:
>
> With this line:
> DEBUG_STATUS && print STDERR ("\n status-> " . $r->status() . ' | '
> . Apache2::Const::OK );
> I'd expect to see
> status-> 200 | 200
This is because your are confusing HTTP status codes and Apache constants. They
are not the same. Apache2::Const::OK (which is what handlers return) is
different from Apache2::Const::HTTP_OK (which is what the browser eventually gets).
mod_perl 1 tried to make it easy by translating a '200' that was returned by a
handler into a '0', but it was really just covering mistakes by developers (me
included).
--
Michael Peters
Developer
Plus Three, LP