aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi/confirm.py
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-07-17 06:39:50 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-07-17 06:39:50 +0900
commit8a31986e68316d0a06919990abad096ee6c0e041 (patch)
tree3d198ba9f0e4e17eaa242c3a4587ee6ec1ae852f /Mailman/Cgi/confirm.py
parent8cac32e5bac4495139573b07da94c255522e8498 (diff)
parentb17234a23a590d9b27f3f609781596eea27b6974 (diff)
downloadmailman2-8a31986e68316d0a06919990abad096ee6c0e041.tar.gz
mailman2-8a31986e68316d0a06919990abad096ee6c0e041.tar.xz
mailman2-8a31986e68316d0a06919990abad096ee6c0e041.zip
Merge lp:mailman/2.1 up to rev 1664
Diffstat (limited to '')
-rw-r--r--Mailman/Cgi/confirm.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Mailman/Cgi/confirm.py b/Mailman/Cgi/confirm.py
index 97297e10..fec69dd2 100644
--- a/Mailman/Cgi/confirm.py
+++ b/Mailman/Cgi/confirm.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2015 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2016 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -73,7 +73,17 @@ def main():
# Get the form data to see if this is a second-step confirmation
cgidata = cgi.FieldStorage(keep_blank_values=1)
- cookie = cgidata.getvalue('cookie')
+ try:
+ cookie = cgidata.getvalue('cookie')
+ except TypeError:
+ # Someone crafted a POST with a bad Content-Type:.
+ doc.AddItem(Header(2, _("Error")))
+ doc.AddItem(Bold(_('Invalid options to CGI script.')))
+ # Send this with a 400 status.
+ print 'Status: 400 Bad Request'
+ print doc.Format()
+ return
+
if cookie == '':
ask_for_cookie(mlist, doc, _('Confirmation string was empty.'))
return