On 11/12/99 12:15 AM, Randal L. Schwartz wrote:
> You need to decline in the content handler if the content type is
> DIR_MAGIC_TYPE (defined in Apache::Constants::DIR_MAGIC_TYPE), and
> that'll fall through to mod_autoindex and/or mod_dir.  If that comes
> back to you (to handle index.html or whatever is found first if it
> exists), you'll see it as a chained request with a $r->prev of the
> request you declined earlier.

Ah...I was trying to handle DIR_MAGIC_TYPE requests myself.  If you
love a content-type, set it free... ;)

> Also, if you choose to *handle* DIR_MAGIC_TYPE, you *must* decline
> (return DECLINED) if the URL does not end in a slash (letting mod_dir
> handle it again).  Very Important.

Hmm, I was forcibly redirecting DIR_MAGIC_TYPE requests that didn't
end in / to the URL with the / appended.

> Use to learn DECLINED.  DECLINED is your friend!
> 
> Doug will correct me if I'm wrong, but I had to work this out while
> I was playing with my mod_perl Picture server, available online
> as <http://www.stonehenge.com/merlyn/WebTechniques/col41.html>.

This is very helpful, and I was actually rejecting everything but
text/html initially.  But I guess my situation is a bit more complex
than my simple example.  I have a PerlTransHandler hacking up the
URL so simply returning DECLINED is not what I want.  "Un-hacking"
the URL by replacing what was changed/removed and then returning
declined is not exactly what I want either, since the unhacked URL
no longer points to a physical directory.  I'm also trying
to sling my pnotes() along for the ride, etc.

So while I now better understand how to let mod_dir/autoindex handle
this for me in the common case, I'd also like to know if its possible
for me to do in Perl what mod_dir/autoindex do.  I'm thinking of
something like the re-implementation of mod_mime and the static page
handler examples in the O'Reilly Apache book.  I think that's the
"final solution" I'm looking for.  It would give me total control.

Now I'm thinking about caching the server "index file" config at
startup time (if I can figure out how to get to it!) in a global array
and then searching for each index file, giving up only when none are
found.  That's basically what mod_dir does, correct?

One more question: I see chdir_file() in the Picture server.  Is
that something mod_dir expects before you return DECLINED?

Thanks for the help :)

-John

Reply via email to