Permalink
Browse files

stripped out trailing slash stuff and fixed routes to eliminate the h…

…ordes of spurious redirects
  • Loading branch information...
storborg committed Nov 4, 2009
1 parent cef3f80 commit 235ad83ce04a5ad0b6fae19715ded53a37e26f2e
Showing with 1 addition and 14 deletions.
  1. +0 −2 bluechips/config/middleware.py
  2. +1 −2 bluechips/config/routing.py
  3. +0 −10 bluechips/lib/base.py
@@ -8,7 +8,6 @@
from pylons.middleware import ErrorHandler, StatusCodeRedirect
from pylons.wsgiapp import PylonsApp
from routes.middleware import RoutesMiddleware
-from paste import httpexceptions
import authkit.authorize
@@ -43,7 +42,6 @@ def make_app(global_conf, full_stack=True, **app_conf):
# CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
app = authkit.authorize.middleware(app, BlueChipUser())
app = DummyAuthenticate(app, app_conf)
- app = httpexceptions.make_middleware(app, global_conf)
# Routing/Session/Cache Middleware
app = RoutesMiddleware(app, config['routes.map'])
@@ -19,8 +19,7 @@ def make_map():
# CUSTOM ROUTES HERE
map.connect('/', controller='status', action='index')
- map.connect('/:controller')
- map.connect('/:controller/', action='index')
+ map.connect('/:controller', action='index')
map.connect('/:controller/:action')
map.connect('/:controller/:action/:id')
View
@@ -11,8 +11,6 @@
from bluechips import model
from bluechips.model import meta
-from paste.request import construct_url
-from paste.httpexceptions import HTTPMovedPermanently
class BaseController(WSGIController):
@@ -21,14 +19,6 @@ def __call__(self, environ, start_response):
# WSGIController.__call__ dispatches to the Controller method
# the request is routed to. This routing information is
# available in environ['pylons.routes_dict']
- if environ['pylons.routes_dict']['controller'] != 'error':
- if environ['PATH_INFO'].endswith('/index'):
- environ['PATH_INFO'] = environ['PATH_INFO'][:-5]
- raise HTTPMovedPermanently(construct_url(environ))
- if not environ['PATH_INFO'].endswith('/') and \
- environ['pylons.routes_dict']['action'] == 'index':
- environ['PATH_INFO'] += '/'
- raise HTTPMovedPermanently(construct_url(environ))
try:
return WSGIController.__call__(self, environ, start_response)
finally:

0 comments on commit 235ad83

Please sign in to comment.