Cleaner Content-Type detection for mimeToMessage()

This commit is contained in:
the-djmaze 2022-02-03 23:36:48 +01:00
parent 983a2db418
commit 384230f7bf

View file

@ -62,7 +62,7 @@ const
mimeToMessage = (data, message) => { mimeToMessage = (data, message) => {
// TODO: Check multipart/signed application/pgp-signature application/pgp-keys // TODO: Check multipart/signed application/pgp-signature application/pgp-keys
const headers = data.split(/\r?\n\r?\n/)[0]; const headers = data.split(/\r?\n\r?\n/)[0];
if (/Content-Type:[\s\S]*?;\s*boundary=/.test(headers)) { if (/Content-Type:[\s\S]*?/.test(headers)) {
// https://github.com/postalsys/postal-mime // https://github.com/postalsys/postal-mime
(new PostalMime).parse(data).then(result => { (new PostalMime).parse(data).then(result => {
// TODO: multipart/signed // TODO: multipart/signed