diff options
author | Erik Johnston <erik@matrix.org> | 2019-01-24 18:52:34 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-01-24 18:52:34 +0000 |
commit | efb8ed1d453fc9f76f9e9225532281963b7ea53c (patch) | |
tree | 62626873812dfce5f24b556b406b47a47159b214 /synapse/http | |
parent | Replace missed usages of FrozenEvent (diff) | |
parent | Merge pull request #4448 from matrix-org/erikj/get_pdu_versions (diff) | |
download | synapse-efb8ed1d453fc9f76f9e9225532281963b7ea53c.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/require_format_version
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/client.py | 5 | ||||
-rw-r--r-- | synapse/http/federation/matrix_federation_agent.py | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index afcf698b29..47a1f82ff0 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -333,9 +333,10 @@ class SimpleHttpClient(object): "POST", uri, headers=Headers(actual_headers), data=query_bytes ) + body = yield make_deferred_yieldable(readBody(response)) + if 200 <= response.code < 300: - body = yield make_deferred_yieldable(treq.json_content(response)) - defer.returnValue(body) + defer.returnValue(json.loads(body)) else: raise HttpResponseException(response.code, response.phrase, body) diff --git a/synapse/http/federation/matrix_federation_agent.py b/synapse/http/federation/matrix_federation_agent.py index 64c780a341..0ec28c6696 100644 --- a/synapse/http/federation/matrix_federation_agent.py +++ b/synapse/http/federation/matrix_federation_agent.py @@ -101,7 +101,8 @@ class MatrixFederationAgent(object): if port is not None: target = (host, port) else: - server_list = yield self._srv_resolver.resolve_service(server_name_bytes) + service_name = b"_matrix._tcp.%s" % (server_name_bytes, ) + server_list = yield self._srv_resolver.resolve_service(service_name) if not server_list: target = (host, 8448) logger.debug("No SRV record for %s, using %s", host, target) |