mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-09-02 10:54:05 +07:00
node_modules: upgrade
This commit is contained in:
16
node_modules/nodemailer/lib/mail-composer/index.js
generated
vendored
16
node_modules/nodemailer/lib/mail-composer/index.js
generated
vendored
@ -86,20 +86,32 @@ class MailComposer {
|
||||
let icalEvent, eventObject;
|
||||
let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {
|
||||
let data;
|
||||
let isMessageNode = /^message\//i.test(attachment.contentType);
|
||||
|
||||
if (/^data:/i.test(attachment.path || attachment.href)) {
|
||||
attachment = this._processDataUrl(attachment);
|
||||
}
|
||||
|
||||
let contentType = attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');
|
||||
|
||||
let isImage = /^image\//i.test(contentType);
|
||||
let isMessageNode = /^message\//i.test(contentType);
|
||||
|
||||
let contentDisposition = attachment.contentDisposition || (isMessageNode || (isImage && attachment.cid) ? 'inline' : 'attachment');
|
||||
|
||||
let contentTransferEncoding;
|
||||
if ('contentTransferEncoding' in attachment) {
|
||||
// also contains `false`, to set
|
||||
contentTransferEncoding = attachment.contentTransferEncoding;
|
||||
} else if (isMessageNode) {
|
||||
contentTransferEncoding = '7bit';
|
||||
} else {
|
||||
contentTransferEncoding = 'base64'; // the default
|
||||
}
|
||||
|
||||
data = {
|
||||
contentType,
|
||||
contentDisposition,
|
||||
contentTransferEncoding: 'contentTransferEncoding' in attachment ? attachment.contentTransferEncoding : 'base64'
|
||||
contentTransferEncoding
|
||||
};
|
||||
|
||||
if (attachment.filename) {
|
||||
|
Reference in New Issue
Block a user