summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-08-03 17:29:38 -0700
committerAndrew Morgan <andrew@amorgan.xyz>2020-08-03 17:29:38 -0700
commit17cbac54f4ef6d5127f6d11077ffa4000aba39f5 (patch)
treea3e6c77922dc759f731f5050b7dba75f1f7dd140 /synapse/api/errors.py
parentMerge commit 'd9e47af61' into anoa/dinsic_release_1_18_x (diff)
parentDo not use canonicaljson to magically handle decoding bytes from JSON. (#7802) (diff)
downloadsynapse-17cbac54f4ef6d5127f6d11077ffa4000aba39f5.tar.xz
Merge commit '66a4af8d9' into anoa/dinsic_release_1_18_x
* commit '66a4af8d9':
  Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py

index 20aff11c81..7b79bba14c 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py
@@ -16,13 +16,11 @@ # limitations under the License. """Contains exceptions and error codes.""" - +import json import logging from http import HTTPStatus from typing import Dict, List -from canonicaljson import json - from twisted.web import http logger = logging.getLogger(__name__) @@ -581,7 +579,7 @@ class HttpResponseException(CodeMessageException): # try to parse the body as json, to get better errcode/msg, but # default to M_UNKNOWN with the HTTP status as the error text try: - j = json.loads(self.response) + j = json.loads(self.response.decode("utf-8")) except ValueError: j = {}