summary refs log tree commit diff
path: root/synapse/federation/transport/server/__init__.py
diff options
context:
space:
mode:
authorSean Quah <seanq@element.io>2021-12-07 13:57:18 +0000
committerSean Quah <seanq@element.io>2021-12-07 13:57:18 +0000
commitdbceb006887f18176358321b24287a1a0d3afb9f (patch)
tree594fe58a9fa44bda1f9487fae3ae790770507da5 /synapse/federation/transport/server/__init__.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parent1.49.0rc1 (diff)
downloadsynapse-dbceb006887f18176358321b24287a1a0d3afb9f.tar.xz
Merge branch 'release-v1.49' into matrix-org-hotfixes
Diffstat (limited to 'synapse/federation/transport/server/__init__.py')
-rw-r--r--synapse/federation/transport/server/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/federation/transport/server/__init__.py b/synapse/federation/transport/server/__init__.py

index c32539bf5a..77b936361a 100644 --- a/synapse/federation/transport/server/__init__.py +++ b/synapse/federation/transport/server/__init__.py
@@ -22,7 +22,10 @@ from synapse.federation.transport.server._base import ( Authenticator, BaseFederationServlet, ) -from synapse.federation.transport.server.federation import FEDERATION_SERVLET_CLASSES +from synapse.federation.transport.server.federation import ( + FEDERATION_SERVLET_CLASSES, + FederationTimestampLookupServlet, +) from synapse.federation.transport.server.groups_local import GROUP_LOCAL_SERVLET_CLASSES from synapse.federation.transport.server.groups_server import ( GROUP_SERVER_SERVLET_CLASSES, @@ -299,7 +302,7 @@ def register_servlets( authenticator: Authenticator, ratelimiter: FederationRateLimiter, servlet_groups: Optional[Iterable[str]] = None, -): +) -> None: """Initialize and register servlet classes. Will by default register all servlets. For custom behaviour, pass in @@ -324,6 +327,13 @@ def register_servlets( ) for servletclass in DEFAULT_SERVLET_GROUPS[servlet_group]: + # Only allow the `/timestamp_to_event` servlet if msc3030 is enabled + if ( + servletclass == FederationTimestampLookupServlet + and not hs.config.experimental.msc3030_enabled + ): + continue + servletclass( hs=hs, authenticator=authenticator,