mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:56:07 -04:00
Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)
This commit is contained in:
parent
d9e47af617
commit
66a4af8d96
7 changed files with 17 additions and 28 deletions
|
@ -15,13 +15,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__)
|
||||
|
@ -573,7 +571,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 = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue