mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 06:23:52 +01:00
Empty string is not a valid JSON object, so don't return them in HTTP responses.
This commit is contained in:
parent
250ee2ea7d
commit
982604fbf2
3 changed files with 7 additions and 7 deletions
|
@ -70,7 +70,7 @@ class LoginFallbackRestServlet(RestServlet):
|
||||||
def on_GET(self, request):
|
def on_GET(self, request):
|
||||||
# TODO(kegan): This should be returning some HTML which is capable of
|
# TODO(kegan): This should be returning some HTML which is capable of
|
||||||
# hitting LoginRestServlet
|
# hitting LoginRestServlet
|
||||||
return (200, "")
|
return (200, {})
|
||||||
|
|
||||||
|
|
||||||
def _parse_json(request):
|
def _parse_json(request):
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ProfileDisplaynameRestServlet(RestServlet):
|
||||||
yield self.handlers.profile_handler.set_displayname(
|
yield self.handlers.profile_handler.set_displayname(
|
||||||
user, auth_user, new_name)
|
user, auth_user, new_name)
|
||||||
|
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
|
|
||||||
def on_OPTIONS(self, request, user_id):
|
def on_OPTIONS(self, request, user_id):
|
||||||
return (200, {})
|
return (200, {})
|
||||||
|
@ -86,7 +86,7 @@ class ProfileAvatarURLRestServlet(RestServlet):
|
||||||
yield self.handlers.profile_handler.set_avatar_url(
|
yield self.handlers.profile_handler.set_avatar_url(
|
||||||
user, auth_user, new_name)
|
user, auth_user, new_name)
|
||||||
|
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
|
|
||||||
def on_OPTIONS(self, request, user_id):
|
def on_OPTIONS(self, request, user_id):
|
||||||
return (200, {})
|
return (200, {})
|
||||||
|
|
|
@ -154,14 +154,14 @@ class RoomStateEventRestServlet(RestServlet):
|
||||||
# membership events are special
|
# membership events are special
|
||||||
handler = self.handlers.room_member_handler
|
handler = self.handlers.room_member_handler
|
||||||
yield handler.change_membership(event)
|
yield handler.change_membership(event)
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
else:
|
else:
|
||||||
# store random bits of state
|
# store random bits of state
|
||||||
msg_handler = self.handlers.message_handler
|
msg_handler = self.handlers.message_handler
|
||||||
yield msg_handler.store_room_data(
|
yield msg_handler.store_room_data(
|
||||||
event=event
|
event=event
|
||||||
)
|
)
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
|
|
||||||
|
|
||||||
# TODO: Needs unit testing for generic events + feedback
|
# TODO: Needs unit testing for generic events + feedback
|
||||||
|
@ -249,7 +249,7 @@ class JoinRoomAliasServlet(RestServlet):
|
||||||
)
|
)
|
||||||
handler = self.handlers.room_member_handler
|
handler = self.handlers.room_member_handler
|
||||||
yield handler.change_membership(event)
|
yield handler.change_membership(event)
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def on_PUT(self, request, room_identifier, txn_id):
|
def on_PUT(self, request, room_identifier, txn_id):
|
||||||
|
@ -416,7 +416,7 @@ class RoomMembershipRestServlet(RestServlet):
|
||||||
)
|
)
|
||||||
handler = self.handlers.room_member_handler
|
handler = self.handlers.room_member_handler
|
||||||
yield handler.change_membership(event)
|
yield handler.change_membership(event)
|
||||||
defer.returnValue((200, ""))
|
defer.returnValue((200, {}))
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def on_PUT(self, request, room_id, membership_action, txn_id):
|
def on_PUT(self, request, room_id, membership_action, txn_id):
|
||||||
|
|
Loading…
Reference in a new issue