summary refs log tree commit diff
path: root/synapse/federation/transport/server.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-03-11 17:27:37 +0000
committerMark Haines <mjark@negativecurvature.net>2016-03-11 17:27:37 +0000
commitffb9dd02feaeef7766c603952bc382ca1e75dcca (patch)
tree792ef6135a1a1a52f39a83a8e2ff6e2e28e949c7 /synapse/federation/transport/server.py
parentFix SQL statement (diff)
parentUse parse_json_object_from_request to parse JSON out of request bodies (diff)
downloadsynapse-ffb9dd02feaeef7766c603952bc382ca1e75dcca.tar.xz
Merge pull request #643 from matrix-org/markjh/parse_json_II
Use parse_json_object_from_request to parse JSON out of request bodies
Diffstat (limited to 'synapse/federation/transport/server.py')
-rw-r--r--synapse/federation/transport/server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py
index 6e92e2f8f4..208bff8d4f 100644
--- a/synapse/federation/transport/server.py
+++ b/synapse/federation/transport/server.py
@@ -18,6 +18,7 @@ from twisted.internet import defer
 from synapse.api.urls import FEDERATION_PREFIX as PREFIX
 from synapse.api.errors import Codes, SynapseError
 from synapse.http.server import JsonResource
+from synapse.http.servlet import parse_json_object_from_request
 from synapse.util.ratelimitutils import FederationRateLimiter
 
 import functools
@@ -419,8 +420,7 @@ class On3pidBindServlet(BaseFederationServlet):
 
     @defer.inlineCallbacks
     def on_POST(self, request):
-        content_bytes = request.content.read()
-        content = json.loads(content_bytes)
+        content = parse_json_object_from_request(request)
         if "invites" in content:
             last_exception = None
             for invite in content["invites"]: