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

Fix redirecting to the webclient for non-HTTP(S) web_client_location. (#11783)

To not change the behaviour during the deprecation period.

Follow-up to #11774.
parent 121b9e24
No related branches found
No related tags found
No related merge requests found
Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration.
...@@ -131,11 +131,18 @@ class SynapseHomeServer(HomeServer): ...@@ -131,11 +131,18 @@ class SynapseHomeServer(HomeServer):
resources.update(self._module_web_resources) resources.update(self._module_web_resources)
self._module_web_resources_consumed = True self._module_web_resources_consumed = True
# try to find something useful to redirect '/' to # Try to find something useful to serve at '/':
#
# 1. Redirect to the web client if it is an HTTP(S) URL.
# 2. Redirect to the web client served via Synapse.
# 3. Redirect to the static "Synapse is running" page.
# 4. Do not redirect and use a blank resource.
if self.config.server.web_client_location_is_redirect: if self.config.server.web_client_location_is_redirect:
root_resource: Resource = RootOptionsRedirectResource( root_resource: Resource = RootOptionsRedirectResource(
self.config.server.web_client_location self.config.server.web_client_location
) )
elif WEB_CLIENT_PREFIX in resources:
root_resource = RootOptionsRedirectResource(WEB_CLIENT_PREFIX)
elif STATIC_PREFIX in resources: elif STATIC_PREFIX in resources:
root_resource = RootOptionsRedirectResource(STATIC_PREFIX) root_resource = RootOptionsRedirectResource(STATIC_PREFIX)
else: else:
......
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