Merge pull request #1025 from nkoshell/route-version-params
Route version params
This commit is contained in:
commit
7a3f9daccf
|
@ -119,10 +119,8 @@ class Router:
|
||||||
:return: Nothing
|
:return: Nothing
|
||||||
"""
|
"""
|
||||||
if version is not None:
|
if version is not None:
|
||||||
if uri.startswith('/'):
|
version = re.escape(str(version).strip('/').lstrip('v'))
|
||||||
uri = "/".join(["/v{}".format(str(version)), uri[1:]])
|
uri = "/".join(["/v{}".format(version), uri.lstrip('/')])
|
||||||
else:
|
|
||||||
uri = "/".join(["/v{}".format(str(version)), uri])
|
|
||||||
# add regular version
|
# add regular version
|
||||||
self._add(uri, methods, handler, host, name)
|
self._add(uri, methods, handler, host, name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user