Fix #815
This commit is contained in:
parent
3e4dbf93d9
commit
af5a0853bf
2 changed files with 10 additions and 0 deletions
|
|
@ -949,6 +949,9 @@ class Flask(_PackageBoundObject):
|
|||
# a tuple of only `GET` as default.
|
||||
if methods is None:
|
||||
methods = getattr(view_func, 'methods', None) or ('GET',)
|
||||
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 that should always be added
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue