diff --git a/sanic/app.py b/sanic/app.py index 6c55a586..63700e9d 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -270,7 +270,7 @@ class Sanic: 'Endpoint with name `{}` was not found'.format( view_name)) - if uri.endswith('/'): + if uri != '/' and uri.endswith('/'): uri = uri[:-1] out = uri diff --git a/sanic/blueprints.py b/sanic/blueprints.py index 10a1fcca..98b924b6 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -41,7 +41,7 @@ class Blueprint: # Prepend the blueprint URI prefix if available uri = url_prefix + future.uri if url_prefix else future.uri app.route( - uri=uri, + uri=uri[1:] if uri.startswith('//') else uri, methods=future.methods, host=future.host or self.host )(future.handler)