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

Remove duplicate slashes in generated consent URLs #4192

Merged
merged 3 commits into from Nov 16, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4192.bugfix
@@ -0,0 +1 @@
Fix an issue where public consent URLs had two slashes.
2 changes: 1 addition & 1 deletion synapse/handlers/auth.py
Expand Up @@ -473,7 +473,7 @@ def _get_params_terms(self):
"version": self.hs.config.user_consent_version,
"en": {
"name": self.hs.config.user_consent_policy_name,
"url": "%s/_matrix/consent?v=%s" % (
"url": "%s_matrix/consent?v=%s" % (
self.hs.config.public_baseurl,
self.hs.config.user_consent_version,
),
Expand Down
4 changes: 2 additions & 2 deletions synapse/rest/client/v2_alpha/auth.py
Expand Up @@ -161,7 +161,7 @@ def on_GET(self, request, stagetype):

html = TERMS_TEMPLATE % {
'session': session,
'terms_url': "%s/_matrix/consent?v=%s" % (
'terms_url': "%s_matrix/consent?v=%s" % (
self.hs.config.public_baseurl,
self.hs.config.user_consent_version,
),
Expand Down Expand Up @@ -242,7 +242,7 @@ def on_POST(self, request, stagetype):
else:
html = TERMS_TEMPLATE % {
'session': session,
'terms_url': "%s/_matrix/consent?v=%s" % (
'terms_url': "%s_matrix/consent?v=%s" % (
self.hs.config.public_baseurl,
self.hs.config.user_consent_version,
),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_terms_auth.py
Expand Up @@ -43,7 +43,7 @@ def prepare(self, reactor, clock, hs):
def test_ui_auth(self):
self.hs.config.user_consent_at_registration = True
self.hs.config.user_consent_policy_name = "My Cool Privacy Policy"
self.hs.config.public_baseurl = "https://example.org"
self.hs.config.public_baseurl = "https://example.org/"
self.hs.config.user_consent_version = "1.0"

# Do a UI auth request
Expand Down