]> khamidou — GitHub mirrors - flanker.git/commitdiff
Label broken MIME attachments as ContentType: application/octet-stream rather than...
authorJeremy Schlatter <jeremy.schlatter@gmail.com>
Wed, 3 Dec 2014 00:08:29 +0000 (16:08 -0800)
committerJeremy Schlatter <jeremy.schlatter@gmail.com>
Wed, 3 Dec 2014 00:08:29 +0000 (16:08 -0800)
flanker/mime/create.py

index 816826d76cdddd24c873583ae859a9773c5b02c6..7b8cefaa8a61ba132435d70e7ebf22b20f354403 100644 (file)
@@ -69,7 +69,7 @@ def attachment(content_type, body, filename=None,
             message.headers['Content-Disposition'] = WithParams(disposition)
             return message
         except DecodingError:
-            content_type = ContentType('text', 'plain')
+            content_type = ContentType('application', 'octet-stream')
     return binary(
         content_type.main,
         content_type.sub,