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:
Armin Ronacher 2010-07-28 01:25:08 +02:00
parent 8a14a875d2
commit dbf55de7e8
3 changed files with 33 additions and 4 deletions

View file

@ -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('/')