diff --git a/src/attachment.hh b/src/attachment.hh index e9d783e..04dcecc 100644 --- a/src/attachment.hh +++ b/src/attachment.hh @@ -19,7 +19,7 @@ namespace pEpMIME { explicit Attachment(const bloblist_t* b, unsigned nr_in_bloblist, bool has_pEp_msg_attachment) : data{b->size ? sv{b->value, b->size} : sv{}} - , mime_type{b->mime_type} + , mime_type{exists(b->mime_type) ? b->mime_type : "application/octet-stream"} , filename{exists(b->filename) ? b->filename : sv{}} , dtype{b->disposition} , need_te{need_transport_encoding(data)} @@ -37,7 +37,7 @@ namespace pEpMIME Attachment(sv _data, sv _mime_type) : data{_data} - , mime_type{_mime_type} + , mime_type{_mime_type.size() ? _mime_type : "application/octet-stream"} , filename{} , dtype{ PEP_CONTENT_DISP_OTHER } , need_te{ need_transport_encoding(data) }