|
@@ -14,7 +14,6 @@
|
|
|
# limitations under the License.
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
-import json
|
|
|
import logging
|
|
|
import random
|
|
|
import time
|
|
@@ -33,6 +32,7 @@ from twisted.web.iweb import IAgent
|
|
|
|
|
|
from sydent.http.httpcommon import BodyExceededMaxSize, read_body_with_max_size
|
|
|
from sydent.http.srvresolver import SrvResolver, pick_server_from_list
|
|
|
+from sydent.util import json_decoder
|
|
|
from sydent.util.ttlcache import TTLCache
|
|
|
|
|
|
# period to cache .well-known results for by default
|
|
@@ -324,7 +324,7 @@ class MatrixFederationAgent(object):
|
|
|
if response.code != 200:
|
|
|
raise Exception("Non-200 response %s" % (response.code, ))
|
|
|
|
|
|
- parsed_body = json.loads(body.decode('utf-8'))
|
|
|
+ parsed_body = json_decoder.decode(body.decode('utf-8'))
|
|
|
logger.info("Response from .well-known: %s", parsed_body)
|
|
|
if not isinstance(parsed_body, dict):
|
|
|
raise Exception("not a dict")
|
|
@@ -444,4 +444,4 @@ class _RoutingResult(object):
|
|
|
The port we should route the TCP connection to (the target of the SRV record, or
|
|
|
the port from the URL/.well-known, or 8448)
|
|
|
:type: int
|
|
|
- """
|
|
|
+ """
|