> You can add these lines to the top of your dhandler to handle the redirect
> yourself:
>
> <%init>;
> use Apache::Constants qw(DIR_MAGIC_TYPE);
> $m->abort(-1) if $r->content_type eq DIR_MAGIC_TYPE && $r->uri !~ m{/$};
> </%init>
-1 is DECLINED, right?
>
> The status of this problem in mod_perl 2 is unknown at this time. It's
> possible that it doesn't exist in mod_perl 2, because unlike in mod_perl 1,
> mod_perl 2 is not configured to handle C<DIR_MAGIC_TYPE> requests, so
> C<mod_dir> will handle them. But since Mason likes to handle directory
> requests when C<decline_dirs> is disabled, it seems likely that Mason will
> need to install a fixup handler to set itself up to handle such
> requests. When HTML::Mason::ApacheHandler loads, it will need to call C<<
> $s->add_config >> to add a PerlFixupHandler, which would likely look
> something like this:
>
> sub fixup_handler {
> my $r = shift;
> $r->handler('perl_script') # or $r->handler('modperl')
> unless $r->content_type eq DIR_MAGIC_TYPE && $r->uri =~ m{/$};
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.
> return DECLINED;
> }
returning OK from a fixup handler is probably more idiomatic.
>
> So none of the above solutions should be necessary in mod_perl 2, but as of
> this writing, I don't know how things work with Mason in mod_perl 2.
I think it's clear that you can't handle directories in mason with mod_perl
2 until a fixup handler like that is installed - mp2 simply doesn't enter
into requests for directories at the moment (or so it would seem).
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]