On Fri, 2013-01-04 at 11:46 -0800, Jonathan Swartz wrote:
> Oliver - I think you're right, this was a mistake. It was the result
> of
> 
>    https://github.com/jonswar/perl-mason/issues/8
> 
> I'm not sure what the right behavior should be. For the sake of good
> SEO, you generally want canonical urls and it's suboptimal to
> allow /foo/bar and /foo/bar/ to map to the exact same thing. One of
> them should redirect to the other. In the old Apache world, /foo/bar
> would redirect to /foo/bar/, but these days it is much more common to
> have urls without trailing slashes.
So we need a tristate attribute: ignore, seo and oldschool ;-)

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.
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). 

> Feedback welcome. I agree, though, the current situation is very
> un-DWIM-ish.
Adding is_index like is_dhandler to Mason::Component::ClassMeta and
check for this in _build_match_request_path should fix the real problem.

Regards,
Oliver
-- 
Oliver Paukstadt <pst...@sourcentral.org>


------------------------------------------------------------------------------
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
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to