Skip to content

Commit

Permalink
Merge branch '2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 17, 2018
2 parents 2a04fbd + 06ed15e commit 53c05ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Changelog

.. towncrier release notes start
2.3.9 (2018-01-16)
==================

- Fix colon handing in path for dynamic resources (#2670)

2.3.8 (2018-01-15)
==================

Expand Down
3 changes: 2 additions & 1 deletion aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ def _match(self, path):
if match is None:
return None
else:
return {key: URL(value, encoded=True).path for key, value in
return {key: URL.build(path=value, encoded=True).path
for key, value in
match.groupdict().items()}

def raw_match(self, path):
Expand Down
11 changes: 11 additions & 0 deletions tests/test_urldispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ async def test_add_with_matchdict(router):
assert info.route.name is None


async def test_add_with_matchdict_with_colon(router):
handler = make_handler()
router.add_route('GET', '/handler/{to}', handler)
req = make_request('GET', '/handler/1:2:3')
info = await router.resolve(req)
assert info is not None
assert {'to': '1:2:3'} == info
assert handler is info.handler
assert info.route.name is None


async def test_add_route_with_add_get_shortcut(router):
handler = make_handler()
router.add_get('/handler/to/path', handler)
Expand Down

0 comments on commit 53c05ea

Please sign in to comment.