Skip to content

Commit

Permalink
Fix #2670: Process colon in path correctly. Release 2.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 17, 2018
1 parent ed61667 commit 06ed15e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion aiohttp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.3.8'
__version__ = '2.3.9'

# This relies on each of the submodules having an __all__ variable.

Expand Down
3 changes: 2 additions & 1 deletion aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,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 get_info(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/test_urldispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ def test_add_with_matchdict(router):
assert info.route.name is None


@asyncio.coroutine
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 = yield from 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


@asyncio.coroutine
def test_add_route_with_add_get_shortcut(router):
handler = make_handler()
Expand Down

0 comments on commit 06ed15e

Please sign in to comment.