summaryrefslogtreecommitdiff
path: root/src/mailman/rest/post_moderation.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-08-29 22:51:58 -0400
committerBarry Warsaw2017-08-29 22:51:58 -0400
commit057bc0704ab6d975e327c11cac204decfb478c4d (patch)
tree9c22f42b28dd6818188fe6ecf5aefb53c192d503 /src/mailman/rest/post_moderation.py
parentde8c204fa40f0c4677a1b73b2ee7e3e86ce93a9c (diff)
downloadmailman-master.tar.gz
mailman-master.tar.zst
mailman-master.zip
Squashed commit of the following:HEADmaster
commit 3c6500c2292869f94667520f16c8d6c6f1d2c530 Author: Barry Warsaw <barry@python.org> Date: Tue Aug 29 22:51:18 2017 -0400 Close #383 Messages with badly encoded ``Subject`` headers no longer crash the message moderation REST API. commit f6040ec139bcccd48cfa9acc734cd528a8ede35c Author: Aurélien Bompard <aurelien@bompard.org> Date: Thu Jul 27 00:52:05 2017 +0200 Fix #383: email encoding errors can crash the REST API
Diffstat (limited to '')
-rw-r--r--src/mailman/rest/post_moderation.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mailman/rest/post_moderation.py b/src/mailman/rest/post_moderation.py
index a747917de..b972bed53 100644
--- a/src/mailman/rest/post_moderation.py
+++ b/src/mailman/rest/post_moderation.py
@@ -95,7 +95,7 @@ class _HeldMessageBase(_ModerationBase):
# Store the original header and then try decoding it.
resource['original_subject'] = resource['subject']
# If we can't decode the header, leave the subject unchanged.
- with suppress(LookupError, MessageError):
+ with suppress(LookupError, MessageError, UnicodeDecodeError):
resource['subject'] = str(
make_header(decode_header(resource['subject'])))
# Also, held message resources will always be this type, so ignore