>> I think that 'unless' should be 'if' - if the request is for a directory,
>> and if the directory has a trailing slash, set the content handler to be
>> perl-script.  I think the above logic demorgans out to
>>
>>   if ( ! $r->content_type eq DIR_MAGIC_TYPE || $uri !~ m{/$} )
>>
>> which isn't quite right.  sorry if that is what I wrote before.
> 
> 
> Don't think so, it's my fault for not thinking it through (I'm so used
> to telling mod_perl _not_ to handle something! I'll change it to this:
> 
>  sub fixup_handler {
>      my $r = shift;
>      $r->handler('perl_script') # or $r->handler('modperl')
>        if $r->content_type ne DIR_MAGIC_TYPE || $r->uri =~ m{/$};
>      return DECLINED;
>  }

ok, that still looks funky.  here's where I'm coming from, which may be
different than where you're coming from :)

mod_perl is typically set up to handle stuff correctly.  the problem exists
where mod_perl is handling directories without trailing slashes, which
should typically be handled by mod_dir.

the above logic activates mod_perl as the content handler for any URI that
isn't a unix directory.  that logic should be reserved for SetHandler or
similar directives within httpd.conf.

I think what you want to do is activate mod_perl only for things where
mod_dir would ordinarily be invoked, namely when the URI resolves to a
directory and the URI does not end with a slash.

but you're closer to this than I am, so ymmv.

>> returning OK from a fixup handler is probably more idiomatic.
> 
> 
> Oh, so that doesn't prevent any others from running? 

not for the fixup phase.  OK will terminate the translation, auth, authz,
and mime phases early, though.  for the remaining phases OK just means "move
along", so it will have the same effect.  the general practice within Apache
is to use DECLINED to mean "I didn't do anything (or I don't want Apache to
think I did)" while OK means "I did something," even for phases where OK and
DECLINED will have the same effect (like fixups)

> Okay, great, thanks a million!

sure thing :)

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to