[Israel.pm] mod_perl question: Ending an apache request with an OK status inside a PerlFixupHandler?
margol at beamartyr.net
Wed Apr 28 07:59:36 PDT 2004
Don't return OK. Return FORBIDDEN from the fixuphandler too.
----- Original Message -----
From: "Yuval Yaari" <yuval at windax.com>
To: "Perl in Israel" <perl at perl.org.il>
Sent: Wednesday, April 28, 2004 5:32 PM
Subject: [Israel.pm] mod_perl question: Ending an apache request with an OK
status inside a PerlFixupHandler?
> I have a site written in mod_perl which handles user's permissions very
> nicely... I really like the way its built:
> I have a PerlFixupHandler which checks if the current user has a
> session, if he can view the page type (passed by PerlSetVar) and also
> does some other data validation.
> This is great because it keeps all the dirty work outside my
> PerlHandlers and my PerlHandlers are short and clean.
> They also recieve parameters by pnotes from the PerlFixupHandler and
> they die() if they can't get them (assuring the PerlFixupHandler runs
> before them...).
> Inside the PerlFixupHandler, I returned Apache::Constants::FORBIDDEN();
> and logged the readon, but I decided to give normal errors.
> So I changed all the return lines to call a small subroutine that I
> wrote, that basically opens a template (TT...) and throws the message
> (with "trace" parameters in case it's a my fault [that abovementioned
> PerlSetVar is missing, etc]).
> In the end of that subroutine, I return Apache::Constants::OK();
> The thing is, that it then goes to the PerlHandler.
> I would like the end the request at that point, but still return an OK
> status, and never get to my PerlHandlers.
> Please let me know if you know how this could be achieved (or if it
> isn't possible for any reason...).
> Perl mailing list
> Perl at perl.org.il
More information about the Perl