Fix return content-type to be JSON
Bonus side-effect: this patch makes tests passing again! \o/ Change-Id: I34795b8cdc4e17040bbb0b7f67a076885b76304f Story: 2002789 Task: 22674
This commit is contained in:
parent
8ee4747ed5
commit
3211a9ba68
@ -78,9 +78,13 @@ def returns_json(decorated_func):
|
||||
def decorator(*args, **kwargs):
|
||||
response = decorated_func(*args, **kwargs)
|
||||
if isinstance(response, flask.Response):
|
||||
return flask.Response(response, content_type='application/json')
|
||||
else:
|
||||
return response
|
||||
if isinstance(response, tuple):
|
||||
contents, status = response
|
||||
else:
|
||||
contents, status = response, 200
|
||||
return flask.Response(response=contents, status=status,
|
||||
content_type='application/json')
|
||||
|
||||
return decorator
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user