diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-06-09 07:05:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-09 07:05:32 -0400 |
commit | 11846dff8c667cbe6861ddc821ca7c53e3e2d890 (patch) | |
tree | 5671b8fd94e1cc09d6f0008ff237dd07ea9fd2f3 /synapse/rest | |
parent | Clean up the interface for injecting opentracing over HTTP (#10143) (diff) | |
download | synapse-11846dff8c667cbe6861ddc821ca7c53e3e2d890.tar.xz |
Limit the number of in-flight /keys/query requests from a single device. (#10144)
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/client/v2_alpha/keys.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/client/v2_alpha/keys.py b/synapse/rest/client/v2_alpha/keys.py index a57ccbb5e5..4a28f2c072 100644 --- a/synapse/rest/client/v2_alpha/keys.py +++ b/synapse/rest/client/v2_alpha/keys.py @@ -160,9 +160,12 @@ class KeyQueryServlet(RestServlet): async def on_POST(self, request): requester = await self.auth.get_user_by_req(request, allow_guest=True) user_id = requester.user.to_string() + device_id = requester.device_id timeout = parse_integer(request, "timeout", 10 * 1000) body = parse_json_object_from_request(request) - result = await self.e2e_keys_handler.query_devices(body, timeout, user_id) + result = await self.e2e_keys_handler.query_devices( + body, timeout, user_id, device_id + ) return 200, result |