route logic for trailing slash

This commit is contained in:
Raphael Deem
2017-02-20 15:58:27 -08:00
parent ff5d4276bc
commit 207ec1e032
3 changed files with 30 additions and 1 deletions

View File

@@ -270,6 +270,9 @@ class Sanic:
'Endpoint with name `{}` was not found'.format(
view_name))
if uri.endswith('/'):
uri = uri[:-1]
out = uri
# find all the parameters we will need to build in the URL