diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-09-17 07:04:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 07:04:15 -0400 |
commit | c3c9732c5363ef007dd838dea016719d3ab07a89 (patch) | |
tree | c0693f1120b6240e3b823f4b438c70085a4d7445 /synapse/rest/admin/__init__.py | |
parent | Fix a potential bug of UnboundLocalError (#8329) (diff) | |
download | synapse-c3c9732c5363ef007dd838dea016719d3ab07a89.tar.xz |
Use admin_patterns for all admin APIs. (#8331)
This reduces duplication of the admin prefix in regular expressions.
Diffstat (limited to 'synapse/rest/admin/__init__.py')
-rw-r--r-- | synapse/rest/admin/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/admin/__init__.py b/synapse/rest/admin/__init__.py index 1c88c93f38..abf362c7b7 100644 --- a/synapse/rest/admin/__init__.py +++ b/synapse/rest/admin/__init__.py @@ -16,13 +16,13 @@ import logging import platform -import re import synapse from synapse.api.errors import Codes, NotFoundError, SynapseError from synapse.http.server import JsonResource from synapse.http.servlet import RestServlet, parse_json_object_from_request from synapse.rest.admin._base import ( + admin_patterns, assert_requester_is_admin, historical_admin_path_patterns, ) @@ -61,7 +61,7 @@ logger = logging.getLogger(__name__) class VersionServlet(RestServlet): - PATTERNS = (re.compile("^/_synapse/admin/v1/server_version$"),) + PATTERNS = admin_patterns("/server_version$") def __init__(self, hs): self.res = { |