diff options
author | Patrick Cloke <patrickc@matrix.org> | 2020-09-11 08:30:36 -0400 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2020-09-11 08:30:36 -0400 |
commit | a9dbe98ef93b46758af4f583eeee0fd3e56fa1a4 (patch) | |
tree | 6b1f7dfb16897fe543d937624aa19d8e171381de /synapse/http/matrixfederationclient.py | |
parent | Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281) (diff) | |
parent | Clarify changelog. (diff) | |
download | synapse-a9dbe98ef93b46758af4f583eeee0fd3e56fa1a4.tar.xz |
Merge tag 'v1.20.0rc3' into develop
Synapse 1.20.0rc3 (2020-09-11) ============================== Bugfixes -------- - Fix a bug introduced in v1.20.0rc1 where the wrong exception was raised when invalid JSON data is encountered. ([\#8291](https://github.com/matrix-org/synapse/issues/8291))
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 5 |
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) |