mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
API: set the mimetype on the response
This commit is contained in:
parent
e13ceaf351
commit
8528526f0b
2 changed files with 4 additions and 1 deletions
|
@ -64,6 +64,8 @@ class MemberHandler(object):
|
|||
def delete(self, project, member_id):
|
||||
if project.remove_member(member_id):
|
||||
return Response('OK', status=200)
|
||||
else:
|
||||
return Response('Not Found', status=404)
|
||||
|
||||
|
||||
class BillHandler(object):
|
||||
|
|
|
@ -133,7 +133,8 @@ def serialize(func):
|
|||
return data
|
||||
else:
|
||||
# serialize it
|
||||
return SERIALIZERS.get(mime, "text/json").encode(data)
|
||||
return werkzeug.Response(SERIALIZERS[mime].encode(data),
|
||||
status=200, mimetype=mime)
|
||||
|
||||
return wrapped
|
||||
|
||||
|
|
Loading…
Reference in a new issue