mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 19:15:51 +03:00
Merge pull request #4192 from matrix-org/travis/fix-consent-urls
Remove duplicate slashes in generated consent URLs
This commit is contained in:
commit
0bb273db07
4 changed files with 5 additions and 4 deletions
1
changelog.d/4192.bugfix
Normal file
1
changelog.d/4192.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue