i guess i had never come across it before, but i noticed today, in
an attempt to use $r->location as a prefix for scrubbing path
segments off the front of a request URI, that it's the innermost
<Location> block that matches the URI path and that has a Perl*Handler
in it that is returned, not the one in which the handler was
registered.

i'm curious about what would be a good way of reliably getting at
the value of the proper <Location> block (let's leave LocationMatch,
Files ~ etc out of this for the time being).

consider this (assuming @DocumentRoot@/foo/bar/bitz exists):

<Location /foo>
Options +Indexes +MultiViews
PerlTypeHandler +MyApache::NopHandler
</Location>
<Location /foo/bar>
SetHandler perl-script
PerlHandler +MyApache::NopResponse
</Location>
<Location /foo/bar/bitz>
#whatever, anything
Options +FollowSymlinks
</Location>

suppose MyApache::NopHandler simply outputs $r->location to the
error log, and MyApache::NopResponse outputs the $r->location to the UA.

GET /foo/ yields the listing for /foo/, and NopHandler logs
$r->location to the error log as /foo.

GET /foo/bar yields the results of NopResponse (which just coughs
up its $r->location, /foo/bar), and NopHandler logs $r->location
as /foo/bar, even though it is registered in <Location /foo>.

GET /foo/bar/bitz yields the same results as GET /foo/bar.

how would i reliably get MyApache::NopHandler to only ever emit
"/foo"?

cheers

.dorian

Reply via email to