only strip one slash when registering blueprint

add test and changelog
This commit is contained in:
David Lord 2018-02-23 15:45:37 -08:00
parent 0887245bfd
commit 401423df06
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 20 additions and 4 deletions

View file

@ -9,8 +9,6 @@
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
"""
import re
from functools import update_wrapper
from .helpers import _PackageBoundObject, _endpoint_from_view_func
@ -54,6 +52,9 @@ class BlueprintSetupState(object):
#: The prefix that should be used for all URLs defined on the
#: blueprint.
if url_prefix and url_prefix[-1] == '/':
url_prefix = url_prefix[:-1]
self.url_prefix = url_prefix
#: A dictionary with URL defaults that is added to each and every
@ -68,7 +69,6 @@ class BlueprintSetupState(object):
"""
if self.url_prefix:
rule = self.url_prefix + rule
rule = re.sub('/+', '/', rule)
options.setdefault('subdomain', self.subdomain)
if endpoint is None:
endpoint = _endpoint_from_view_func(view_func)