summary refs log tree commit diff
path: root/synapse/rest/client/v1/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-01 09:43:27 +0000
committerErik Johnston <erik@matrix.org>2016-03-01 09:43:27 +0000
commit903fb34b39cd750050b4c89d9c0f5492652b8fcd (patch)
tree7e74b35c054227b2897ed46bccfb2b4de40f47f6 /synapse/rest/client/v1/room.py
parentReport size of ExpiringCache (diff)
parentMerge pull request #607 from matrix-org/dbkr/send_inviter_member_event (diff)
downloadsynapse-903fb34b39cd750050b4c89d9c0f5492652b8fcd.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/expiring_cache_size
Diffstat (limited to 'synapse/rest/client/v1/room.py')
-rw-r--r--synapse/rest/client/v1/room.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 07a2a5dd82..f5ed4f7302 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -228,7 +228,12 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
             allow_guest=True,
         )
 
-        content = _parse_json(request)
+        try:
+            content = _parse_json(request)
+        except:
+            # Turns out we used to ignore the body entirely, and some clients
+            # cheekily send invalid bodies.
+            content = {}
 
         if RoomID.is_valid(room_identifier):
             room_id = room_identifier
@@ -427,7 +432,12 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
         }:
             raise AuthError(403, "Guest access not allowed")
 
-        content = _parse_json(request)
+        try:
+            content = _parse_json(request)
+        except:
+            # Turns out we used to ignore the body entirely, and some clients
+            # cheekily send invalid bodies.
+            content = {}
 
         if membership_action == "invite" and self._has_3pid_invite_keys(content):
             yield self.handlers.room_member_handler.do_3pid_invite(