mailgun-js
Advanced tools
Comparing version 0.7.7 to 0.7.8
@@ -217,3 +217,3 @@ var https = require('https'); | ||
this.form.append(key, fs.createReadStream(obj.data), { | ||
filename: obj.filename || 'file' | ||
filename: obj.filename || 'attached file' | ||
}); | ||
@@ -223,12 +223,22 @@ } | ||
debug('appending attachment buffer to form data. key: %s filename: %s', key, obj.filename); | ||
this.form.append(key, obj.data, { | ||
filename: obj.filename || 'file' | ||
}); | ||
var formOpts = { | ||
filename: obj.filename || 'attached file' | ||
}; | ||
if (obj.contentType) { | ||
formOpts.contentType = obj.contentType | ||
} | ||
if (obj.knownLength) { | ||
formOpts.knownLength = obj.knownLength | ||
} | ||
this.form.append(key, obj.data, formOpts); | ||
} | ||
else if (attachmentType === 'stream') { | ||
if (obj.knownLength && obj.contentType) { | ||
debug('appending attachment buffer to form data. key: %s filename: %s', key, obj.filename); | ||
debug('appending attachment stream to form data. key: %s filename: %s', key, obj.filename); | ||
this.form.append(key, obj.data, { | ||
filename: obj.filename || 'file', | ||
filename: obj.filename || 'attached file', | ||
contentType: obj.contentType, | ||
@@ -235,0 +245,0 @@ knownLength: obj.knownLength |
@@ -8,11 +8,11 @@ { | ||
], | ||
"version": "0.7.7", | ||
"homepage": "https://github.com/1lobby/mailgun-js", | ||
"version": "0.7.8", | ||
"homepage": "https://github.com/bojand/mailgun-js", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/1lobby/mailgun-js.git" | ||
"url": "git://github.com/bojand/mailgun-js.git" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/1lobby/mailgun-js/issues" | ||
"url": "http://github.com/bojand/mailgun-js/issues" | ||
}, | ||
@@ -19,0 +19,0 @@ "engines": { |
102512
2265