Re: index files do not work on 2.20 if allow_path_info is not set

Pedro Melo <[email protected]> Fri, 4 Jan 2013 23:50:00 +0000
Newsgroups gmane.comp.web.mason.user
Message-ID <CACCxPi2YemAOOUVbOa8j1=jTsckKb94rHe8NELaMLtr2QGSJFA@mail.gmail.com>
Hi,

On Fri, Jan 4, 2013 at 8:15 PM, Oliver Paukstadt <[email protected]> wrote:
> Question is, where to do the redirects. Since index_names and
> dhandler_names are in mason attributes the first instance which knows
> about "matches an index file" is mason.
> Doing this with psgi middleware needs knowledge about masons behavior
> and additional file-system checks there and that is not a good idea.

PSGI is not an option. The .mc/.mi components might not be in the filesystem…

> Doing it in the application, in an allow_path_info enabled index.mc file
> could be a solution as well: redirect if path_info is empty (or equals
> slash).
[….]
> Adding is_index like is_dhandler to Mason::Component::ClassMeta and
> check for this in _build_match_request_path should fix the real problem.

Depends on your definition of what the real problem is :). You use
case is only one situation. Add dhandlers or components with
allow_path_info => 1 and the redirect is no longer the correct
behaviour.

See my previous email for the scenario where I think the redirect is a
possible correct solution. It should be easy to implement that inside
_build_match_request_path…

I can look into this is a consensus on what the correct behaviour is.

Bye,
-- 
Pedro Melo
@pedromelo
http://www.simplicidade.org/
http://about.me/melo
xmpp:[email protected]
mailto:[email protected]

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users