added a new behaviour for responses that enable the tuple to be in the form of (response, headers) and continiue to support the (response, status, headers) format.

This commit is contained in:
Mikael Åhlén 2013-12-31 22:16:13 +01:00
parent afd3c4532b
commit 70f8b39c52
3 changed files with 39 additions and 12 deletions

View file

@ -676,9 +676,9 @@ converting return values into response objects is as follows:
default parameters.
3. If a tuple is returned the items in the tuple can provide extra
information. Such tuples have to be in the form ``(response, status,
headers)`` where at least one item has to be in the tuple. The
`status` value will override the status code and `headers` can be a
list or dictionary of additional header values.
headers)`` or ``(response, headers)`` where at least one item has
to be in the tuple. The `status` value will override the status code
and `headers` can be a list or dictionary of additional header values.
4. If none of that works, Flask will assume the return value is a
valid WSGI application and convert that into a response object.