forked from MirrorHub/synapse
Return JSON errors for unknown resources under /matrix/client. (#11930)
Re-applies the changes from3e0cfd447e
(#11602), revertingd93ec0a0ba
(#11764) now that the conflict with the webclient listener was fixed in119edf51eb
(#11895).
This commit is contained in:
parent
3655585e85
commit
380c3d40f4
2 changed files with 3 additions and 7 deletions
1
changelog.d/11930.bugfix
Normal file
1
changelog.d/11930.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix a long-standing bug that some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors.
|
|
@ -26,6 +26,7 @@ import synapse
|
||||||
import synapse.config.logger
|
import synapse.config.logger
|
||||||
from synapse import events
|
from synapse import events
|
||||||
from synapse.api.urls import (
|
from synapse.api.urls import (
|
||||||
|
CLIENT_API_PREFIX,
|
||||||
FEDERATION_PREFIX,
|
FEDERATION_PREFIX,
|
||||||
LEGACY_MEDIA_PREFIX,
|
LEGACY_MEDIA_PREFIX,
|
||||||
MEDIA_R0_PREFIX,
|
MEDIA_R0_PREFIX,
|
||||||
|
@ -195,13 +196,7 @@ class SynapseHomeServer(HomeServer):
|
||||||
|
|
||||||
resources.update(
|
resources.update(
|
||||||
{
|
{
|
||||||
"/_matrix/client/api/v1": client_resource,
|
CLIENT_API_PREFIX: client_resource,
|
||||||
"/_matrix/client/r0": client_resource,
|
|
||||||
"/_matrix/client/v1": client_resource,
|
|
||||||
"/_matrix/client/v3": client_resource,
|
|
||||||
"/_matrix/client/unstable": client_resource,
|
|
||||||
"/_matrix/client/v2_alpha": client_resource,
|
|
||||||
"/_matrix/client/versions": client_resource,
|
|
||||||
"/.well-known": well_known_resource(self),
|
"/.well-known": well_known_resource(self),
|
||||||
"/_synapse/admin": AdminRestResource(self),
|
"/_synapse/admin": AdminRestResource(self),
|
||||||
**build_synapse_client_resource_tree(self),
|
**build_synapse_client_resource_tree(self),
|
||||||
|
|
Loading…
Reference in a new issue