From 663e0178728b6618064743a737f72889f014787e Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Mon, 25 Apr 2011 15:18:56 -0700 Subject: Mailman now sets the 'secure' flag in cookies set via https URLs. Bug #770377. --- Mailman/SecurityManager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Mailman') 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 -- cgit v1.2.3