Update app.py
use Python's build-in function `rstrip('/')` to remove the tail slash instead of judge if the tail char is slash and then remove it.
This commit is contained in:
parent
dbcbf12456
commit
25553602a0
|
@ -382,8 +382,8 @@ class Sanic:
|
||||||
'Endpoint with name `{}` was not found'.format(
|
'Endpoint with name `{}` was not found'.format(
|
||||||
view_name))
|
view_name))
|
||||||
|
|
||||||
if uri != '/' and uri.endswith('/'):
|
if uri != '/':
|
||||||
uri = uri[:-1]
|
uri = uri.rstrip('/')
|
||||||
|
|
||||||
out = uri
|
out = uri
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user