Skip to content
Snippets Groups Projects
Unverified Commit 781c15a6 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Merge pull request #2663 from matrix-org/rav/invalid_request_utf8

Fix 500 on invalid utf-8 in request
parents ab335edb 8b33ac8f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment