Added removing duplicate 'v' for Router.add() version parameter

Fix sanic/router.py:123:80: E501 line too long (80 > 79 characters)
This commit is contained in:
Nikita Koshelev 2017-11-18 01:39:00 +03:00
parent 8e7475ccf6
commit 76511d61e0

View File

@ -119,8 +119,8 @@ class Router:
:return: Nothing
"""
if version is not None:
version = re.escape(str(version))
uri = "/".join(["/v{}".format(version.strip('/')), uri.lstrip('/')])
version = re.escape(str(version).strip('/').lstrip('v'))
uri = "/".join(["/v{}".format(version), uri.lstrip('/')])
# add regular version
self._add(uri, methods, handler, host, name)