Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6652f51

Browse files
committedJan 20, 2022
Fix redirecting to the webclient for non-HTTP(S).
1 parent 7bf2d6c commit 6652f51

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

Diff for: ‎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.

Diff for: ‎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: Resource = RootOptionsRedirectResource(WEB_CLIENT_PREFIX)
139146
elif STATIC_PREFIX in resources:
140147
root_resource = RootOptionsRedirectResource(STATIC_PREFIX)
141148
else:

0 commit comments

Comments
 (0)
This repository has been archived.