Skip to content
Snippets Groups Projects
Unverified Commit 380c3d40 authored by Patrick Cloke's avatar Patrick Cloke Committed by GitHub
Browse files

Return JSON errors for unknown resources under /matrix/client. (#11930)

Re-applies the changes from 3e0cfd44 (#11602),
reverting d93ec0a0 (#11764) now that the conflict
with the webclient listener was fixed in 119edf51 (#11895).
parent 3655585e
No related branches found
No related tags found
No related merge requests found
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
from synapse import events
from synapse.api.urls import (
CLIENT_API_PREFIX,
FEDERATION_PREFIX,
LEGACY_MEDIA_PREFIX,
MEDIA_R0_PREFIX,
......@@ -195,13 +196,7 @@ class SynapseHomeServer(HomeServer):
resources.update(
{
"/_matrix/client/api/v1": 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,
CLIENT_API_PREFIX: client_resource,
"/.well-known": well_known_resource(self),
"/_synapse/admin": AdminRestResource(self),
**build_synapse_client_resource_tree(self),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment