Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit d090996

Browse files
authored
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.
1 parent 121b9e2 commit d090996

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

changelog.d/11783.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration.

synapse/app/homeserver.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,18 @@ def _listener_http(
131131
resources.update(self._module_web_resources)
132132
self._module_web_resources_consumed = True
133133

134-
# try to find something useful to redirect '/' to
134+
# Try to find something useful to serve at '/':
135+
#
136+
# 1. Redirect to the web client if it is an HTTP(S) URL.
137+
# 2. Redirect to the web client served via Synapse.
138+
# 3. Redirect to the static "Synapse is running" page.
139+
# 4. Do not redirect and use a blank resource.
135140
if self.config.server.web_client_location_is_redirect:
136141
root_resource: Resource = RootOptionsRedirectResource(
137142
self.config.server.web_client_location
138143
)
144+
elif WEB_CLIENT_PREFIX in resources:
145+
root_resource = RootOptionsRedirectResource(WEB_CLIENT_PREFIX)
139146
elif STATIC_PREFIX in resources:
140147
root_resource = RootOptionsRedirectResource(STATIC_PREFIX)
141148
else:

0 commit comments

Comments
 (0)