aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/SecurityManager.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py
index dceb3d00..902c1fdd 100644
--- a/Mailman/SecurityManager.py
+++ b/Mailman/SecurityManager.py
@@ -245,8 +245,13 @@ class SecurityManager:
c[key] = binascii.hexlify(marshal.dumps((issued, mac)))
# The path to all Mailman stuff, minus the scheme and host,
# i.e. usually the string `/mailman'
- path = urlparse(self.web_page_url)[2]
+ parsed = urlparse(self.web_page_url)
+ path = parsed.path
c[key]['path'] = path
+ # Make sure to set the 'secure' flag on the cookie if mailman is
+ # accessed by an https url.
+ if parsed.scheme == 'https':
+ c[key]['secure'] = True
# We use session cookies, so don't set `expires' or `max-age' keys.
# Set the RFC 2109 required header.
c[key]['version'] = 1