From ff3d33d5e019e12fcc8cc95a0bf6fe290b11f73e Mon Sep 17 00:00:00 2001 From: lixxu Date: Fri, 24 Feb 2017 00:17:43 +0800 Subject: [PATCH] bug: url_for in blueprint may have // at the beginning --- sanic/blueprints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)