summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-11-13 18:35:24 +0000
committerGitHub <noreply@github.com>2017-11-13 18:35:24 +0000
commit781c15a6a30a15f350c462b830a74b943ee6ae49 (patch)
tree7b48d39b17a82fa3751f5429b77bd5f7803aa40f
parentRevert "move _state_group_cache to statestore" (diff)
parentMerge branch 'develop' into rav/invalid_request_utf8 (diff)
downloadsynapse-781c15a6a30a15f350c462b830a74b943ee6ae49.tar.xz
Merge pull request #2663 from matrix-org/rav/invalid_request_utf8
Fix 500 on invalid utf-8 in request
-rw-r--r--synapse/http/servlet.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py
index 8118ee7cc2..71420e54db 100644
--- a/synapse/http/servlet.py
+++ b/synapse/http/servlet.py
@@ -167,7 +167,8 @@ def parse_json_value_from_request(request):
 
     try:
         content = simplejson.loads(content_bytes)
-    except simplejson.JSONDecodeError:
+    except Exception as e:
+        logger.warn("Unable to parse JSON: %s", e)
         raise SynapseError(400, "Content not JSON.", errcode=Codes.NOT_JSON)
 
     return content