Skip to content

Commit f9f0881

Browse files
author
Sefi Krausz
committed
changes
1 parent ddf16b0 commit f9f0881

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ HTTPSnippet.prototype.prepare = function (request) {
128128
var form = new MultiPartForm()
129129

130130
request.postData.params.forEach((param) => {
131-
console.log(param)
132131
form.append(param.name, param.value || '')
133132
})
134133

@@ -139,7 +138,6 @@ HTTPSnippet.prototype.prepare = function (request) {
139138
// request.postData.boundary = this.getBoundary()
140139
// request.headersObj['content-type'] = 'multipart/form-data; boundary=' + this.getBoundary()
141140
request.headersObj['content-type'] = 'multipart/form-data'
142-
console.log(form)
143141
}
144142
break
145143

src/targets/node/unirest.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,18 @@ module.exports = function (source, options) {
6464
var multipart = []
6565

6666
source.postData.params.forEach(function (param) {
67-
console.log('unirest.js 67', param)
6867
var part = {}
69-
68+
const { name } = param || 'body'
7069
if (param.fileName && !param.value) {
7170
includeFS = true
7271

73-
part.body = 'fs.createReadStream("' + param.fileName + '")'
72+
part[name] = 'fs.createReadStream("' + param.fileName + '")'
7473
} else if (param.value) {
75-
const { name } = param || 'body'
74+
7675
part[name] = param.value
7776
}
7877

79-
if (part.body) {
78+
if (part[name]) {
8079
if (param.contentType) {
8180
part['content-type'] = param.contentType
8281
}

0 commit comments

Comments
 (0)