]> khamidou — GitHub mirrors - flanker.git/commitdiff
Allow `Content-Type` header value be of ContentType class
authorMaxim Vladimirsky <horkhe@gmail.com>
Mon, 28 Jul 2014 10:47:55 +0000 (14:47 +0400)
committerMaxim Vladimirsky <horkhe@gmail.com>
Mon, 28 Jul 2014 10:47:55 +0000 (14:47 +0400)
flanker/mime/message/fallback/part.py

index 7ad9a6612abd32cd3ad012cf21fbd2347c493328..70685b372273fd81d7de2a11ffb604407535eaf2 100644 (file)
@@ -31,6 +31,9 @@ class FallbackMimePart(RichPartMixin):
 
     @property
     def content_type(self):
+        content_type = self._headers['Content-Type']
+        if isinstance(content_type, ContentType):
+            return content_type
         return ContentType(
             self._m.get_content_maintype(),
             self._m.get_content_subtype(),