From 25553602a0b0a7f2ca1261199e744ba6dc144603 Mon Sep 17 00:00:00 2001 From: kingname Date: Mon, 26 Jun 2017 12:02:56 +0800 Subject: [PATCH] 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. --- sanic/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index ff680d9c..7c25d15c 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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