Commit Graph

3 Commits (c69dbed7eed3d50f35cd59b05f174b81c802b20d)

Author SHA1 Message Date
Dustin C. Hatch c69dbed7ee routing: Correctly redirect when path info is empty (fixes #7)
When the application path info is empty (e.g. the WSGI script is mounted
somewhere other than the root), appending a trailing slash and redirecting
causes the new location to be calculated incorrectly. This is because the part
of the request URL before the application path is not taken into account, so
the new path always ends up being a literal `/`. This commit changes the
behavior of the `redir` function that is returned by
`milla.dispatch.routing.Router.resolve` to calculate the new path info
correctly in the redirect response.
2015-02-19 19:58:03 -06:00
Dustin C. Hatch f5f7e76dae Added tests for Router's trailing slash handling options 2012-11-30 22:46:28 -06:00
Dustin C. Hatch 6cf47a0339 Added a traversal dispatch method and cleaned up the router
* Created a dispatcher protocol for classes to implement for path resolution
* Implemented a traversal dispatcher
* Updated the router to implement the dispatcher protocol
* Added unit tests for both dispatchers
* Replaced the Controller class with an Application class
2011-03-26 23:35:31 -05:00