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

Commit 98ff028

Browse files
committed
Partially revert #11602 to prevent webclient overriding client resource
known client resource prefixes under one, simplified '/_matrix/client' prefix. Unfortunately, '/_matrix/client' is already a prefix used by the 'webclient' resource. As we use a Python dictionary to hold a mapping from prefix to resource, configuring a 'webclient' resource after a 'client' resource would end up with all client requests being redirected to the webclient resource (which doesn't know how to handle things like /login or /sync). Reverting #11602 fixes the bug while maintaining JSON responses as the PR intended. However, this bug has highlighted how fragile the resource code is currently.
1 parent 4ec0a30 commit 98ff028

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

synapse/app/homeserver.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import synapse.config.logger
2828
from synapse import events
2929
from synapse.api.urls import (
30-
CLIENT_API_PREFIX,
3130
FEDERATION_PREFIX,
3231
LEGACY_MEDIA_PREFIX,
3332
MEDIA_R0_PREFIX,
@@ -193,7 +192,13 @@ def _configure_named_resource(
193192

194193
resources.update(
195194
{
196-
CLIENT_API_PREFIX: client_resource,
195+
"/_matrix/client/api/v1": client_resource,
196+
"/_matrix/client/r0": client_resource,
197+
"/_matrix/client/v1": client_resource,
198+
"/_matrix/client/v3": client_resource,
199+
"/_matrix/client/unstable": client_resource,
200+
"/_matrix/client/v2_alpha": client_resource,
201+
"/_matrix/client/versions": client_resource,
197202
"/.well-known": well_known_resource(self),
198203
"/_synapse/admin": AdminRestResource(self),
199204
**build_synapse_client_resource_tree(self),

0 commit comments

Comments
 (0)