I must say I agree that in general we should do something like
@expose(slash=???). However, for the DataController.show method we
can't really have slash=True **or** slash=False.

If slash=True, then /model/5/show won't work right, if slash=False,
then /model/5/ won't work right either. Something needs to be done,
maybe add this to "show" ?

path = cherrypy.request.path; if path[-4] != "show" and path[-1] !=
"/": raise HTTPRedirect( path + "/")

Or make it so you can't access the show method in two ways. If
/model/5/show *never* works (maybe raise a 404 or something.. whomever
wrote the DataController should know better) then we can safely set
slash to True.

In general, it's interesting that you mention it, I made a similar
ticket in CherryPy earlier today:
http://www.cherrypy.org/ticket/433

I would even submit a patch for that except I am not using CherryPy
SVN. If that is fixed though, object's without an index method will
never be allowed to have a trailing / :), and vice versa.

Reply via email to