Load `/capabilities` endpoint on workers (#15436)

This commit is contained in:
Dirk Klimpel 2023-04-14 18:26:07 +02:00 committed by GitHub
parent b5192355f6
commit e4a25d022c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1 @@
Allow loading `/capabilities` endpoint on workers.

View File

@ -174,6 +174,7 @@ WORKERS_CONFIG: Dict[str, Dict[str, Any]] = {
"^/_matrix/client/(r0|v3|unstable)/user/.*/filter(/|$)",
"^/_matrix/client/(r0|v3|unstable)/password_policy$",
"^/_matrix/client/(api/v1|r0|v3|unstable)/directory/room/.*$",
"^/_matrix/client/(r0|v3|unstable)/capabilities$",
],
"shared_extra_conf": {},
"worker_extra_conf": "",

View File

@ -235,6 +235,7 @@ information.
^/_matrix/client/(api/v1|r0|v3|unstable)/search$
^/_matrix/client/(r0|v3|unstable)/user/.*/filter(/|$)
^/_matrix/client/(api/v1|r0|v3|unstable)/directory/room/.*$
^/_matrix/client/(r0|v3|unstable)/capabilities$
# Encryption requests
^/_matrix/client/(r0|v3|unstable)/keys/query$

View File

@ -133,8 +133,8 @@ class ClientRestResource(JsonResource):
if is_main_process:
room_upgrade_rest_servlet.register_servlets(hs, client_resource)
room_batch.register_servlets(hs, client_resource)
capabilities.register_servlets(hs, client_resource)
if is_main_process:
capabilities.register_servlets(hs, client_resource)
account_validity.register_servlets(hs, client_resource)
relations.register_servlets(hs, client_resource)
password_policy.register_servlets(hs, client_resource)

View File

@ -33,6 +33,7 @@ class CapabilitiesRestServlet(RestServlet):
"""End point to expose the capabilities of the server."""
PATTERNS = client_patterns("/capabilities$")
CATEGORY = "Client API requests"
def __init__(self, hs: "HomeServer"):
super().__init__()