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

Commit

Permalink
Clarify documentation about escaping URLs in templates. (#9310)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Feb 3, 2021
1 parent 7a0dcea commit afa18f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
1 change: 1 addition & 0 deletions changelog.d/9310.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the sample configuration for changes made to the template loading code.
14 changes: 4 additions & 10 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,7 @@ sso:
#
# When rendering, this template is given the following variables:
# * redirect_url: the URL that the user will be redirected to after
# login. Needs manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# login.
#
# * server_name: the homeserver's name.
#
Expand Down Expand Up @@ -2040,15 +2039,12 @@ sso:
#
# When rendering, this template is given the following variables:
#
# * redirect_url: the URL the user is about to be redirected to. Needs
# manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# * redirect_url: the URL the user is about to be redirected to.
#
# * display_url: the same as `redirect_url`, but with the query
# parameters stripped. The intention is to have a
# human-readable URL to show to users, not to use it as
# the final address to redirect to. Needs manual escaping
# (see https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# the final address to redirect to.
#
# * server_name: the homeserver's name.
#
Expand All @@ -2068,9 +2064,7 @@ sso:
# process: 'sso_auth_confirm.html'.
#
# When rendering, this template is given the following variables:
# * redirect_url: the URL the user is about to be redirected to. Needs
# manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# * redirect_url: the URL the user is about to be redirected to.
#
# * description: the operation which the user is being asked to confirm
#
Expand Down
14 changes: 4 additions & 10 deletions synapse/config/sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def generate_config_section(self, **kwargs):
#
# When rendering, this template is given the following variables:
# * redirect_url: the URL that the user will be redirected to after
# login. Needs manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# login.
#
# * server_name: the homeserver's name.
#
Expand Down Expand Up @@ -185,15 +184,12 @@ def generate_config_section(self, **kwargs):
#
# When rendering, this template is given the following variables:
#
# * redirect_url: the URL the user is about to be redirected to. Needs
# manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# * redirect_url: the URL the user is about to be redirected to.
#
# * display_url: the same as `redirect_url`, but with the query
# parameters stripped. The intention is to have a
# human-readable URL to show to users, not to use it as
# the final address to redirect to. Needs manual escaping
# (see https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# the final address to redirect to.
#
# * server_name: the homeserver's name.
#
Expand All @@ -213,9 +209,7 @@ def generate_config_section(self, **kwargs):
# process: 'sso_auth_confirm.html'.
#
# When rendering, this template is given the following variables:
# * redirect_url: the URL the user is about to be redirected to. Needs
# manual escaping (see
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
# * redirect_url: the URL the user is about to be redirected to.
#
# * description: the operation which the user is being asked to confirm
#
Expand Down

0 comments on commit afa18f1

Please sign in to comment.