Browse Source

MIME-16: albeit a blob with no mime_type is invalid, I shall not crash than.

master
roker 5 months ago
parent
commit
c67b8c1105
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/attachment.hh

+ 2
- 2
src/attachment.hh View File

@ -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) }


Loading…
Cancel
Save