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(
|
||||
view_name))
|
||||
|
||||
if uri != '/' and uri.endswith('/'):
|
||||
uri = uri[:-1]
|
||||
if uri != '/':
|
||||
uri = uri.rstrip('/')
|
||||
|
||||
out = uri
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user