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

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

Merged
merged 2 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11783.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration.
9 changes: 8 additions & 1 deletion synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,18 @@ def _listener_http(
resources.update(self._module_web_resources)
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:
root_resource: Resource = RootOptionsRedirectResource(
self.config.server.web_client_location
)
elif WEB_CLIENT_PREFIX in resources:
root_resource = RootOptionsRedirectResource(WEB_CLIENT_PREFIX)
elif STATIC_PREFIX in resources:
root_resource = RootOptionsRedirectResource(STATIC_PREFIX)
else:
Expand Down