Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2491 (closed defect: migrated)

Opened 9 years ago

Last modified 8 years ago

"Smart" content type handling overriding url args in obscure cases

Reported by: seedifferently Owned by:
Priority: high Milestone: 2.2b1
Component: TurboGears Version: 2.2
Severity: normal Keywords:
Cc:

Description

I'm not entirely sure if this is a "bug" or a feature:

I am aware of TG's "smart" content type handling which is supposed to return content types based on how the request URL ends, but today I ran across an odd case where it doesn't behave as expected.

Take the url:  http://localhost/load_email/user@host.com

And the controller method:

@expose('json')
def load_email(self, email):
    return dict(email=email)

In the above case, even if I request JSON from this method, it will strip off ".com" and only make the value of "email" == user@host (rather than user@…). I am assuming this is due to TG's "magic request type handling", but isn't that a bit over-zealous?

Now, the *right* way to do this is probably to use  http://localhost/load_email?email=user@host.com, but I would think it should work the other way as well.

Please advise, Seth

Change History

comment:1 Changed 9 years ago by chrisz

  • Milestone changed from __unclassified__ to 2.1rc1

comment:2 Changed 9 years ago by percious

  • Version changed from 2.1a3 to 2.1

comment:3 Changed 9 years ago by percious

  • Milestone changed from 2.1rc1 to 2.1

comment:4 Changed 9 years ago by percious

  • Version changed from 2.1 to 2.2
  • Milestone changed from 2.1 to 2.2b1

comment:5 Changed 8 years ago by pedersen

  • Status changed from new to closed
  • Resolution set to migrated
Note: See TracTickets for help on using tickets.