On Wed, Jul 09, 2008 at 09:28:54PM -0700, Jonathan Swartz wrote:
> Mason resolves top-level URIs to components by looking at $r->filename, 
> then figuring out which component root that file is under. See 
> HTML::Mason::Resolver::File::apache_request_to_comp_path. That's why 
> Perrin's changing of $r->uri didn't work, and why Hans' strategy  
> wouldn't work either.

My strategy *does* work, if you include:

Alias /foo /var/www/foo
<Location /foo>
  SetHandler perl-script
  PerlHandler My::Handler::Foo
</Location>

>>  comp_root => [
>>    [ foo    => '/var/www/foo' ],
>>    [ common => '/var/www/common' ],
>>  ],

This is because apache_request_to_comp_path doesn't actually check that the
file is a valid component -- all it does is make sure that $r->filename starts
with one of the comp_root entries, snips off the comp_root path, and returns
the rest. (Among other things, this means that the target for 'Alias /foo'
could actually be anything in the comp_root.)

A request for http://my.domain.com/foo/index.html then turns into a Mason
request for /index.html, which searches for /var/www/foo/index.html followed by
/var/www/common/index.html.  

http://glaive.weftsoar.net:8080/foo/index.html

-> Hello! This is common/index.html

http://glaive.weftsoar.net:8080/foo/foo.html

-> This is foo/foo.html

http://glaive.weftsoar.net:8080/foo/not-there.html

-> 404 from apache

hdp.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to