Incorporate review

This commit is contained in:
Brendan Abolivier 2019-05-07 11:47:37 +01:00 committed by Brendan Abolivier
parent 3d031c211d
commit b4f3d70b21
3 changed files with 6 additions and 4 deletions

View File

@ -403,7 +403,7 @@ class IdentityHandler(BaseHandler):
target = self.rewrite_identity_server_urls.get(id_server, id_server)
try:
data = yield self.http_client.post_json(
data = yield self.http_client.post_json_get_json(
"https://%s/_matrix/identity/api/v1/bulk_lookup" % (target,),
{
"threepids": threepids,

View File

@ -531,6 +531,8 @@ class ThreepidBulkLookupRestServlet(RestServlet):
body = parse_json_object_from_request(request)
assert_params_in_dict(body, ["threepids", "id_server"])
# Proxy the request to the identity server. lookup_3pid handles checking
# if the lookup is allowed so we don't need to do it here.
ret = yield self.identity_handler.bulk_lookup_3pid(

View File

@ -115,10 +115,10 @@ class IdentityEnabledTestCase(unittest.HomeserverTestCase):
mock_http_client = Mock(spec=[
"get_json",
"post_json",
"post_json_get_json",
])
mock_http_client.get_json.return_value = defer.succeed((200, "{}"))
mock_http_client.post_json.return_value = defer.succeed((200, "{}"))
mock_http_client.post_json_get_json.return_value = defer.succeed((200, "{}"))
self.hs = self.setup_test_homeserver(
config=config,
@ -198,7 +198,7 @@ class IdentityEnabledTestCase(unittest.HomeserverTestCase):
)
self.render(request)
post_json = self.hs.get_simple_http_client().post_json
post_json = self.hs.get_simple_http_client().post_json_get_json
post_json.assert_called_once_with(
"https://testis/_matrix/identity/api/v1/bulk_lookup",
{