Skip to content
Snippets Groups Projects
Unverified Commit b19b63e6 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Don't 500 for invalid group IDs (#8628)

parent a9f90fa7
No related branches found
No related tags found
No related merge requests found
Fix handling of invalid group IDs to return a 400 rather than log an exception and return a 500.
......@@ -17,7 +17,7 @@
import logging
from synapse.api.errors import HttpResponseException, RequestSendFailed, SynapseError
from synapse.types import get_domain_from_id
from synapse.types import GroupID, get_domain_from_id
logger = logging.getLogger(__name__)
......@@ -28,6 +28,9 @@ def _create_rerouter(func_name):
"""
async def f(self, group_id, *args, **kwargs):
if not GroupID.is_valid(group_id):
raise SynapseError(400, "%s was not legal group ID" % (group_id,))
if self.is_mine_id(group_id):
return await getattr(self.groups_server_handler, func_name)(
group_id, *args, **kwargs
......
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