summary refs log tree commit diff
path: root/synapse/http/servlet.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-06-28 14:49:57 +0100
committerGitHub <noreply@github.com>2018-06-28 14:49:57 +0100
commit6350bf925e8651f2fae70a1e7eb7182e9161c34a (patch)
tree35e766fcb2dabcd1e8978c417709b353d5fdf4bc /synapse/http/servlet.py
parentRevert "Revert "Try to not use as much CPU in the StreamChangeCache"" (#3454) (diff)
downloadsynapse-6350bf925e8651f2fae70a1e7eb7182e9161c34a.tar.xz
Attempt to be more performant on PyPy (#3462)
Diffstat (limited to 'synapse/http/servlet.py')
-rw-r--r--synapse/http/servlet.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py
index ef8e62901b..ef3a01ddc7 100644
--- a/synapse/http/servlet.py
+++ b/synapse/http/servlet.py
@@ -18,7 +18,9 @@
 from synapse.api.errors import SynapseError, Codes
 
 import logging
-import simplejson
+
+from canonicaljson import json
+
 
 logger = logging.getLogger(__name__)
 
@@ -171,7 +173,7 @@ def parse_json_value_from_request(request, allow_empty_body=False):
         return None
 
     try:
-        content = simplejson.loads(content_bytes)
+        content = json.loads(content_bytes)
     except Exception as e:
         logger.warn("Unable to parse JSON: %s", e)
         raise SynapseError(400, "Content not JSON.", errcode=Codes.NOT_JSON)