Skip to content
Snippets Groups Projects
Unverified Commit 0bb273db authored by Travis Ralston's avatar Travis Ralston Committed by GitHub
Browse files

Merge pull request #4192 from matrix-org/travis/fix-consent-urls

Remove duplicate slashes in generated consent URLs
parents 8b1affe7 3da9781c
No related branches found
No related tags found
No related merge requests found
Fix an issue where public consent URLs had two slashes.
......@@ -473,7 +473,7 @@ class AuthHandler(BaseHandler):
"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,
),
......
......@@ -161,7 +161,7 @@ class AuthRestServlet(RestServlet):
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,
),
......@@ -242,7 +242,7 @@ class AuthRestServlet(RestServlet):
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,
),
......
......@@ -43,7 +43,7 @@ class TermsTestCase(unittest.HomeserverTestCase):
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment