summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2020-09-11 07:34:53 -0400
committerPatrick Cloke <patrickc@matrix.org>2020-09-11 07:34:53 -0400
commit27ef82d972d990a4d5a3e3e44b3e2bf26d902ece (patch)
tree56a8fce88c93abc1deb5c9ebbf53e6fd94bb20e1 /synapse/http/matrixfederationclient.py
parentMerge branch 'release-v1.20.0' into matrix-org-hotfixes (diff)
parentFix the exception that is raised when invalid JSON is encountered. (#8291) (diff)
downloadsynapse-27ef82d972d990a4d5a3e3e44b3e2bf26d902ece.tar.xz
Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r--synapse/http/matrixfederationclient.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index 775fad3be4..5eaf3151ce 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -54,6 +54,7 @@ from synapse.logging.opentracing import ( start_active_span, tags, ) +from synapse.util import json_decoder from synapse.util.async_helpers import timeout_deferred from synapse.util.metrics import Measure @@ -164,7 +165,9 @@ async def _handle_json_response( try: check_content_type_is_json(response.headers) - d = treq.json_content(response) + # Use the custom JSON decoder (partially re-implements treq.json_content). + d = treq.text_content(response, encoding="utf-8") + d.addCallback(json_decoder.decode) d = timeout_deferred(d, timeout=timeout_sec, reactor=reactor) body = await make_deferred_yieldable(d)