Use flasktools.ensure_response_type.

This commit is contained in:
voussoir 2021-06-04 21:28:23 -07:00
parent d091efb619
commit 1554b86c11
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 1 additions and 2 deletions

View file

@ -65,6 +65,7 @@ def decorate_and_route(*route_args, **route_kwargs):
# Since a function might have multiple routes, we may be seeing the
# same one multiple times. The _fully_decorated will track that.
if not hasattr(endpoint, '_fully_decorated'):
endpoint = flasktools.ensure_response_type(endpoint)
endpoint = decorators.catch_etiquette_exception(endpoint)
endpoint = session_manager.give_token(endpoint)

View file

@ -79,8 +79,6 @@ class SessionManager:
session.maintain()
response = function(*args, **kwargs)
if not isinstance(response, flasktools.RESPONSE_TYPES):
response = flask.Response(response)
# Send the token back to the client
# but only if the endpoint didn't manually set the cookie.