You guys are correct in your analysis. It is definitely a bug, or at least undesirable, when Mason is being used for a view.
It isn't clear whether direct access of /index should be permitted in the general case - you generally don't want multiple URLs mapping to a single page for SEO etc, but then it's unlikely that someone will be fishing around adding /index to arbitrary URLs. Anyway, I'm just going to allow direct access of /index for now. It'll be in the next release. I'm still going to disallow direct access of dhandlers (dhandler.m, dhandler.pm) and autobases (Base.m, Base.pm); these are far less common names and can be disabled if really necessary. Thanks Jon On Feb 23, 2011, at 11:29 AM, Stephen Clouse wrote: > On Wed, Feb 23, 2011 at 7:47 AM, Matthias Dietrich <p...@rainboxx.de> wrote: > Hi, > > it seems that at least with Catalyst::View::Mason2 it is impossible to load a > template 'index.m' in a folder. When specifying 'index' as template (which > is made due to $c->action within C::V::Mason2) it only may find > 'index/index.m', but in no case 'index.m'. > > I'm not deep enough in the code, maybe Jon can help? > > __PACKAGE__->config(index_names => []) should disable that automagic for > /index.(p?m)/. > > It seems to be a bit of a bug, I think. Mason should still recognize a > direct call to the index template; instead it blocks any such request and > coerces it to a directory. I would expect that behavior to be broken in an > environment where Mason is serving as controller and view -- i.e., /foo/bar/ > works but not /foo/bar/index.html. > > It's definitely not the desired behavior under Catalyst, where $c->action is > the default template. Perhaps that index_names setting should be part of > C::V::M2. > > -- > Stephen Clouse <stephenclo...@gmail.com> > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Mason-users mailing list > Mason-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mason-users
------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users