Use flasktools.ensure_response_type.
This commit is contained in:
		
							parent
							
								
									d091efb619
								
							
						
					
					
						commit
						1554b86c11
					
				
					 2 changed files with 1 additions and 2 deletions
				
			
		|  | @ -65,6 +65,7 @@ def decorate_and_route(*route_args, **route_kwargs): | ||||||
|         # Since a function might have multiple routes, we may be seeing the |         # Since a function might have multiple routes, we may be seeing the | ||||||
|         # same one multiple times. The _fully_decorated will track that. |         # same one multiple times. The _fully_decorated will track that. | ||||||
|         if not hasattr(endpoint, '_fully_decorated'): |         if not hasattr(endpoint, '_fully_decorated'): | ||||||
|  |             endpoint = flasktools.ensure_response_type(endpoint) | ||||||
|             endpoint = decorators.catch_etiquette_exception(endpoint) |             endpoint = decorators.catch_etiquette_exception(endpoint) | ||||||
|             endpoint = session_manager.give_token(endpoint) |             endpoint = session_manager.give_token(endpoint) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -79,8 +79,6 @@ class SessionManager: | ||||||
|                 session.maintain() |                 session.maintain() | ||||||
| 
 | 
 | ||||||
|             response = function(*args, **kwargs) |             response = function(*args, **kwargs) | ||||||
|             if not isinstance(response, flasktools.RESPONSE_TYPES): |  | ||||||
|                 response = flask.Response(response) |  | ||||||
| 
 | 
 | ||||||
|             # Send the token back to the client |             # Send the token back to the client | ||||||
|             # but only if the endpoint didn't manually set the cookie. |             # but only if the endpoint didn't manually set the cookie. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue