mailgun-js
Advanced tools
Comparing version 0.19.0 to 0.20.0
@@ -252,12 +252,20 @@ const https = require('https') | ||
} else if (attachmentType === 'stream') { | ||
if (obj.knownLength && obj.contentType) { | ||
debug('appending attachment stream to form data. key: %s filename: %s', key, obj.filename) | ||
if ((obj.knownLength && !obj.contentType) || (!obj.knownLength && obj.contentType)) { | ||
debug('missing content type or length for attachment stream. key: %s', key) | ||
} else { | ||
debug('appending attachment stream to form data. key: %s', key) | ||
this.form.append(key, obj.data, { | ||
'filename': obj.filename || 'attached file', | ||
'contentType': obj.contentType, | ||
'knownLength': obj.knownLength | ||
}) | ||
} else { | ||
debug('missing content type or length for attachment stream. key: %s', key) | ||
// add all known options | ||
let formOpts = {} | ||
if (obj.filename) { | ||
formOpts.filename = obj.filename | ||
} | ||
if (obj.contentType) { | ||
formOpts.contentType = obj.contentType | ||
} | ||
if (obj.knownLength) { | ||
formOpts.knownLength = obj.knownLength | ||
} | ||
this.form.append(key, obj.data, formOpts) | ||
} | ||
@@ -264,0 +272,0 @@ } |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"homepage": "https://github.com/bojand/mailgun-js", | ||
@@ -11,0 +11,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57428
1321