Deny dot's in blueprint endpoints. Add tests for that too.

This commit is contained in:
Pedro Algarvio 2011-08-25 17:26:57 +01:00
parent 04e87a93de
commit 03a71e0229
2 changed files with 53 additions and 0 deletions

View file

@ -166,6 +166,8 @@ class Blueprint(_PackageBoundObject):
"""Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for
the :func:`url_for` function is prefixed with the name of the blueprint.
"""
if endpoint:
assert '.' not in endpoint, "Blueprint endpoint's should not contain dot's"
self.record(lambda s:
s.add_url_rule(rule, endpoint, view_func, **options))