Skip to content

Commit dfbcd5e

Browse files
author
Sefi Krausz
committed
changes
1 parent 347368e commit dfbcd5e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,15 @@ HTTPSnippet.prototype.prepare = function (request) {
127127
if (request.postData.params) {
128128
var form = new MultiPartForm()
129129

130-
request.postData.params.forEach(function (param) {
131-
form.append(param.name, param.value || '', {
130+
const { value } = param || ''
131+
form.append(param.name,
132+
typeof value === 'string'
133+
? new Blob([value])
134+
: value
135+
, {
132136
filename: param.fileName || null,
133137
contentType: param.contentType || null
134138
})
135-
})
136-
137139
// form.pipe(es.map(function (data, cb) {
138140
// request.postData.text += data
139141
// }))

0 commit comments

Comments
 (0)