perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John ORourke <>
Subject Re: return value for response handler
Date Thu, 12 Jun 2008 15:37:27 GMT
Geoffrey Young wrote:
>>> I wanted to redirect the user's browser, and in my response handler I
>>> was setting $r->status(302) but returning Apache2::Const::OK instead of
>>> the correct Apache2::Const::DONE.
> return Apache2::Const::REDIRECT

Unfortunately I can't easily do that here - I have plug-in modules which 
could return any HTTP status, and then some post-processing which makes 
use of the value of $r->status.  I handle ErrorDocument properly though 
by checking for a non-200 status before modifying it.  Then later I 
simply return OK or DONE depending on wether $r->status eq '200' or 
not.  I suppose I could just return ($r->status() eq '200)?OK:$r->status()

Re-reading the above, I suspect I can improve it a little.

> and I explain the internal mechanism here

That's filled in the gaps, many thanks.


View raw message