mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Incorporate review
This commit is contained in:
parent
3d031c211d
commit
b4f3d70b21
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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",
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user