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 #1690 (closed defect: wontfix)

Opened 12 years ago

Last modified 11 years ago

fix subcontroller redirect issue

Reported by: fredlin Owned by: anonymous
Priority: normal Milestone:
Component: TurboGears Version: trunk
Severity: normal Keywords:
Cc:

Description

Code:

class xxx(Controller):
    @expose()
    def index(self):
        redirect('ddr')
    
    @expose()
    def ddr(self):
        return 'orz'

    @expose()
    def rdd(self):
        raise redirect('index')
                
class RootController(BaseController):
    xxx = xxx()

browse  http://localhost:8080/xxx/ works fine, but browse

 http://localhost:8080/xxx (no trail '/') will redirect to

 http://localhost:8080/ddr

which is wrong.

Change History

comment:1 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

Actually, I think that this behaviour, while unexpected to some, is actually correct.

If you were at /xxx.html and wanted to redirect to 'foo' you should go to /foo to xxx.html/foo

the problem is that turbogears allows the trailing slash to be optional, and people generally don't include mime-type information in their URL endpoints, so doing the right thing generates an somewhat unexpected result in this case.

So, closing as won't fix.

comment:2 Changed 11 years ago by anonymous

  • Milestone 2.0-preview-1 deleted

Milestone 2.0-preview-1 deleted

Note: See TracTickets for help on using tickets.