Fixed #1288: app.add_url_rule() should look for OPTIONS methods in a case-insensitive manner

This commit is contained in:
Michael Hall 2014-12-24 11:16:57 -05:00
parent 413ae6137e
commit 98b155c65d
2 changed files with 13 additions and 1 deletions

View file

@ -998,7 +998,7 @@ class Flask(_PackageBoundObject):
if isinstance(methods, string_types):
raise TypeError('Allowed methods have to be iterables of strings, '
'for example: @app.route(..., methods=["POST"])')
methods = set(methods)
methods = set(item.upper() for item in methods)
# Methods that should always be added
required_methods = set(getattr(view_func, 'required_methods', ()))