summaryrefslogtreecommitdiff
path: root/src/mailman/rest/helpers.py
diff options
context:
space:
mode:
authorAurélien Bompard2015-11-20 11:54:31 +0100
committerBarry Warsaw2016-11-28 20:31:09 -0500
commitb521d6739edda8737fb784536d9282fbc708e3e2 (patch)
tree3f9935968abe48f8f66993d50ac5e56322f56265 /src/mailman/rest/helpers.py
parentb570b76724c6341921ebe531071904df312d39e6 (diff)
downloadmailman-b521d6739edda8737fb784536d9282fbc708e3e2.tar.gz
mailman-b521d6739edda8737fb784536d9282fbc708e3e2.tar.zst
mailman-b521d6739edda8737fb784536d9282fbc708e3e2.zip
Diffstat (limited to 'src/mailman/rest/helpers.py')
-rw-r--r--src/mailman/rest/helpers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py
index 9ab1f434e..a4b072408 100644
--- a/src/mailman/rest/helpers.py
+++ b/src/mailman/rest/helpers.py
@@ -23,6 +23,8 @@ import hashlib
from contextlib import suppress
from datetime import datetime, timedelta
+from email.header import Header
+from email.message import Message
from enum import Enum
from lazr.config import as_boolean
from mailman import public
@@ -49,6 +51,10 @@ class ExtendedEncoder(json.JSONEncoder):
return obj.name
elif isinstance(obj, bytes):
return bytes_to_str(obj)
+ elif isinstance(obj, Message):
+ return obj.as_string()
+ elif isinstance(obj, Header):
+ return str(obj)
return super().default(obj)