Skip to content
Myr

Fix #815

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 3e4dbf9 · Browse files · 2 files+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−0 removed

  • other:+10 added−0 removed

2 files+10 added−0 removed

modified:flask/testsuite/basic.py+7 added
83 unmodified lines
84 rv = c.delete('/more')85 self.assert_equal(rv.status_code, 405)86 self.assert_equal(sorted(rv.allow), ['GET', 'HEAD', 'OPTIONS', 'POST'])8788 def test_disallow_string_for_allowed_methods(self):89 app = flask.Flask(__name__)90 with self.assert_raises(TypeError):91 @app.route('/', methods='GET POST')92 def index():93 return "Hey"9495 def test_url_mapping(self):96 app = flask.Flask(__name__)97 def index():98 return flask.request.method
1206 unmodified lines
modified:flask/app.py+3 added
947 unmodified lines
948 # methods we can use that instead. If neither exists, we go with949 # a tuple of only `GET` as default.950 if methods is None:951 methods = getattr(view_func, 'methods', None) or ('GET',)952 if isinstance(methods, string_types):953 raise TypeError('Allowed methods have to be iterables of strings, '954 'for example: @app.route(..., methods=["POST"])')955 methods = set(methods)956957 # Methods that should always be added958 required_methods = set(getattr(view_func, 'required_methods', ()))
883 unmodified lines