You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2001/09/09 21:15:26 UTC

Re: $r->handler() Issue

On Sat, 18 Aug 2001, David Wheeler wrote:

> Hey All,
> 
> I've got a PerlTransHandler where I want to disable, under certain
> circumstances (that is, whenever the content type isn't 'text/html') the
> content handler. However, this code doesn't do the trick:
> 
>     $r->handler('default-handler');
> 
> And neither does this:
> 
>     $r->handler("perl-script");
>     $r->set_handlers('PerlHandler' => [ \&OK ])
> 
> Or even this:
> 
>     $r->handler("perl-script");
>     $r->set_handlers('PerlHandler' => [ \&DECLINED ])
> 
> None of these snippets affects the content phase in any way; the
> PerlHandler I install in httpd.conf gets executed every time, no matter
> what. Can anyone tell me how I can disable my PerlHandler for the current
> request?

you either need to have a PerlTypeHandler that sets $r->handler and
returns OK (to prevent mod_mime from settting it) or set $r->handler with
a PerlFixupHandler.