forked from orbit-oss/flask
Fixed an issue where the default OPTIONS response was
not exposing all valid methods in the `Allow` header. This fixes #97 Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
This commit is contained in:
parent
8a14a875d2
commit
dbf55de7e8
3 changed files with 33 additions and 4 deletions
|
|
@ -120,6 +120,17 @@ class BasicFunctionalityTestCase(unittest.TestCase):
|
|||
assert sorted(rv.allow) == ['GET', 'HEAD', 'OPTIONS', 'POST']
|
||||
assert rv.data == ''
|
||||
|
||||
def test_options_on_multiple_rules(self):
|
||||
app = flask.Flask(__name__)
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
return 'Hello World'
|
||||
@app.route('/', methods=['PUT'])
|
||||
def index_put():
|
||||
return 'Aha!'
|
||||
rv = app.test_client().open('/', method='OPTIONS')
|
||||
assert sorted(rv.allow) == ['GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
|
||||
|
||||
def test_request_dispatching(self):
|
||||
app = flask.Flask(__name__)
|
||||
@app.route('/')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue