From 6ecdbc409d2109a9e7fc5367c64067f0400f07cc Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 22 Jun 2009 00:12:45 +0000 Subject: - Adding ``*path_info`` to a route no longer changes the PATH_INFO for a request that matches using URL dispatch. This feature was only there to service the ``repoze.bfg.wsgi.wsgiapp2`` decorator and it did it wrong; use ``*subpath`` instead now. - The interface generation performed for named request factories had the wrong base classes. --- repoze/bfg/urldispatch.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'repoze/bfg/urldispatch.py') diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index 591a91c57..6d12cae39 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -48,21 +48,6 @@ class RoutesRootFactory(Mapper): environ['bfg.routes.matchdict'] = args adhoc_attrs = environ.setdefault('webob.adhoc_attrs', {}) adhoc_attrs['matchdict'] = args - # this is stolen from routes.middleware; if the route map - # has a *path_info capture, use it to influence the path - # info and script_name of the generated environment - if 'path_info' in args: - if not 'SCRIPT_NAME' in environ: - environ['SCRIPT_NAME'] = '' - oldpath = environ['PATH_INFO'] - newpath = args['path_info'] or '' - environ['PATH_INFO'] = newpath - if not environ['PATH_INFO'].startswith('/'): - environ['PATH_INFO'] = '/' + environ['PATH_INFO'] - pattern = r'^(.*?)/' + re.escape(newpath) + '$' - environ['SCRIPT_NAME'] += re.sub(pattern, r'\1', oldpath) - if environ['SCRIPT_NAME'].endswith('/'): - environ['SCRIPT_NAME'] = environ['SCRIPT_NAME'][:-1] factory = route._factory or self.default_root_factory return factory(environ) -- cgit v1.2.3