From 22e72d7ab95f3c1b363e6b9b13d5b35e72866647 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 1 Nov 2009 18:49:07 +0000 Subject: - Header values returned by the ``authtktauthenticationpolicy`` ``remember`` and ``forget`` methods would be of type ``unicode`` if the ``cookie_name`` attribute was used in the ZCML declaration. This violated the WSGI spec, causing a ``TypeError`` to be raised when these headers were used under ``mod_wsgi``. - If a routes-only BFG app was mounted under a path in modwsgi, ala ``WSGIScriptAlias /myapp /Users/chrism/projects/modwsgi/env/bfg.wsgi``, the home route (a route with the path of ``'/'`` or ``''``) would not match when the path ``/myapp`` was visited (only when the path ``/myapp/`` was visited). This is now fixed: if the urldispatch root factory notes that the PATH_INFO is empty, it converts it to a single slash before trying to do matching. --- repoze/bfg/urldispatch.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'repoze/bfg/urldispatch.py') diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index 715fb07e4..373c11f0b 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -68,6 +68,9 @@ class RoutesRootFactory(object): path = environ['PATH_INFO'] except KeyError: path = '/' + if not path: # empty if mounted under a path in mod_wsgi, for example + path = '/' + for route in self.routelist: match = route.match(path) if match is not None: -- cgit v1.2.3