From bf7ce92bf7307ded3643d8cc5ee01aee21f23f58 Mon Sep 17 00:00:00 2001 From: Sean Quah <8349537+squahtx@users.noreply.github.com> Date: Wed, 11 May 2022 17:22:34 +0100 Subject: Enable cancellation of `GET /members` and `GET /state` requests (#12708) Enable cancellation of `GET /rooms/$room_id/members`, `GET /rooms/$room_id/state` and `GET /rooms/$room_id/state/$state_key/*` requests. Signed-off-by: Sean Quah --- synapse/http/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'synapse/http/server.py') diff --git a/synapse/http/server.py b/synapse/http/server.py index 756c6e1aee..e3dcc3f3dd 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -139,7 +139,9 @@ def cancellable(method: F) -> F: async def on_GET(self, request: SynapseRequest) -> ...: ... """ - if method.__name__ not in _cancellable_method_names: + if method.__name__ not in _cancellable_method_names and not any( + method.__name__.startswith(prefix) for prefix in _cancellable_method_names + ): raise ValueError( "@cancellable decorator can only be applied to servlet methods." ) -- cgit 1.4.1