Merge pull request #481 from lixxu/master
url_for has something wrong with //
This commit is contained in:
commit
68c8796adb
|
@ -270,7 +270,7 @@ class Sanic:
|
||||||
'Endpoint with name `{}` was not found'.format(
|
'Endpoint with name `{}` was not found'.format(
|
||||||
view_name))
|
view_name))
|
||||||
|
|
||||||
if uri.endswith('/'):
|
if uri != '/' and uri.endswith('/'):
|
||||||
uri = uri[:-1]
|
uri = uri[:-1]
|
||||||
|
|
||||||
out = uri
|
out = uri
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Blueprint:
|
||||||
# Prepend the blueprint URI prefix if available
|
# Prepend the blueprint URI prefix if available
|
||||||
uri = url_prefix + future.uri if url_prefix else future.uri
|
uri = url_prefix + future.uri if url_prefix else future.uri
|
||||||
app.route(
|
app.route(
|
||||||
uri=uri,
|
uri=uri[1:] if uri.startswith('//') else uri,
|
||||||
methods=future.methods,
|
methods=future.methods,
|
||||||
host=future.host or self.host
|
host=future.host or self.host
|
||||||
)(future.handler)
|
)(future.handler)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user