You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de> on 2007/09/28 15:34:26 UTC

OutputFilter - using error documents handler to provide error message rather than doing it myself?

Hi.

I've written an output filter which works fine so far.
However, in failure case, i am iterating through the buckets like its done in 
POST200 module and insert a new message like its done there.

However, i am wonder if it is possible to tell the filter in an error case, 
that it should "break" here, remove the buckets, clear all the headers ... 
cleaning all - and setting a 403 status and let apache error document handle 
things (like [R=403, F] in mod_rewrite).
Is there a way to do this?

Torsten

Re: OutputFilter - using error documents handler to provide error message rather than doing it myself?

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Am Freitag, 28. September 2007 schrieb Torsten Krah:
> Hi.
>
> I've written an output filter which works fine so far.
> However, in failure case, i am iterating through the buckets like its done
> in POST200 module and insert a new message like its done there.
>
> However, i am wonder if it is possible to tell the filter in an error case,
> that it should "break" here, remove the buckets, clear all the headers ...
> cleaning all - and setting a 403 status and let apache error document
> handle things (like [R=403, F] in mod_rewrite).
> Is there a way to do this?
>
> Torsten

I'll changed stuff to be an InputFilter instead of an OutputFilter.
I'll to my checks - without changing something - and returning FORBIDDEN in 
case of failure.

The URL which would be served otherwise should not be requested if forbidden 
is found - although, the logs show something like this:


[Fri Sep 28 17:48:54 2007] [error] (403)Unbekannter Fehler 403: proxy: 
prefetch request body failed to 127.0.0.1:81 (localhost) from 127.0.0.1 ()

Why the filter is still going to try to receive things - i though the handler 
(mod_proxy) is reached later in the chain, a call for forbidden should stop 
processing, shouldn't it?

Torsten