Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 46cdb4b

Browse files
author
Sean Quah
committed
Respect the @cancellable flag for DirectServe{Html,Json}Resources
`DirectServeHtmlResource` and `DirectServeJsonResource` both inherit from `_AsyncResource`. These classes expect to be subclassed with `_async_render_*` methods. This commit has no effect on `JsonResource`, despite inheriting from `_AsyncResource`. `JsonResource` has its own `_async_render` override which will need to be updated separately. Signed-off-by: Sean Quah <seanq@element.io>
1 parent 5a9991c commit 46cdb4b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

synapse/http/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ async def _async_render(self, request: SynapseRequest) -> Optional[Tuple[int, An
369369

370370
method_handler = getattr(self, "_async_render_%s" % (request_method,), None)
371371
if method_handler:
372+
request.is_render_cancellable = is_method_cancellable(method_handler)
373+
372374
raw_callback_return = method_handler(request)
373375

374376
# Is it synchronous? We'll allow this for now.

0 commit comments

Comments
 (0)