mailgun-js
Advanced tools
+17
-9
@@ -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 @@ } |
+1
-1
@@ -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", |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
57428
0.37%1321
0.53%