#2322: Mimetypes side effect
------------------------+---------------------------------------------------
Reporter: asabil | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: TurboGears | Version: 2.0rc1
Severity: normal | Keywords:
------------------------+---------------------------------------------------
On Mon, May 11, 2009 at 3:16 PM, Ali Sabil <[email protected]> wrote:
>
> Hi all,
>
> Today I have been bitten by a rather unexpected behaviour from
> Turbogears 2 with the following code:
>
> class UserController(BaseController):
> @expose('foo.templates.user')
> def default(self, user, **kwargs):
> print user
> return dict()
>
>
> This controller works like a charm for this request: /user/ali.sabil
> But produces a rather confusing result for /user/john.man
>
> The problem comes from the fact that .man is a known filename
> extension for a known mimetype, which leads the TG2
> ObjectDispatchController to chop the extension off, and have user=john
> in the controller.
>
> I understand that this behaviour can be very useful in many scenarios,
> but I think TG2 should provide a simple way to disable it completely.
>
That is a totally unexpected side effect.
I think we should upgrade the internal code to only serve the
mimetypes from a restricted list. Instead of depeding on the mimetypes
module which does some weird stuff.
At this point that is a bug that can't be turned off as it assumes
foo.something is a call to the mimetypes system. I guess we could add
a flag to turn it off. Could you open a ticket for this?
--
Ticket URL: <http://trac.turbogears.org/ticket/2322>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---