mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-21 15:18:48 -04:00
Use admin_patterns for all admin APIs. (#8331)
This reduces duplication of the admin prefix in regular expressions.
This commit is contained in:
parent
53284c425e
commit
c3c9732c53
7 changed files with 20 additions and 26 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue