From 3add1b9a5f5210f966db354026a09fe2a263c660 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 17 Sep 2008 18:46:04 +0000 Subject: - Routes URL dispatch did not have access to the WSGI environment, so conditions such as method=GET did not work. --- CHANGES.txt | 7 ++++++- repoze/bfg/tests/test_urldispatch.py | 1 + repoze/bfg/urldispatch.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4825852c1..a1ac46fd6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,7 +2,12 @@ Next release Docs - Documented URL dispatch better in narrative form. + - Documented URL dispatch better in narrative form. + + Bug fixes + + - Routes URL dispatch did not have access to the WSGI environment, + so conditions such as method=GET did not work. 0.3.7 (09/09/2008) diff --git a/repoze/bfg/tests/test_urldispatch.py b/repoze/bfg/tests/test_urldispatch.py index 84c7b5c09..806af28df 100644 --- a/repoze/bfg/tests/test_urldispatch.py +++ b/repoze/bfg/tests/test_urldispatch.py @@ -22,6 +22,7 @@ class RoutesMapperTests(unittest.TestCase): environ = self._getEnviron(PATH_INFO='/') result = mapper(environ) self.assertEqual(result, marker) + self.assertEqual(mapper.mapper.environ, environ) def test_routes_mapper_route_matches(self): marker = () diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index 0be937ab0..46812390a 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -41,6 +41,7 @@ class RoutesMapper(object): self.mapper.create_regs([]) self._regs_created = True path = environ.get('PATH_INFO', '/') + self.mapper.environ = environ args = self.mapper.match(path) if args: context_factory = args.get('context_factory', _marker) -- cgit v1.2.3