Skip to content

Commit 89177c3

Browse files
committed
fix: out of date regex that was causing readstreams to be stringified
1 parent 731d664 commit 89177c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/targets/node/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ module.exports = function (source, options) {
115115
.push('});')
116116
.blank()
117117

118-
return code.join().replace('"JAR"', 'jar').replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")')
118+
return code.join().replace('"JAR"', 'jar').replace(/'fs\.createReadStream\(\"(.+)\"\)'/g, 'fs.createReadStream("$1")')
119119
}
120120

121121
module.exports.info = {

test/fixtures/output/node/request/multipart-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var options = {
77
headers: {'content-type': 'multipart/form-data; boundary=---011000010111000001101001'},
88
formData: {
99
foo: {
10-
value: 'fs.createReadStream("test/fixtures/files/hello.txt")',
10+
value: fs.createReadStream("test/fixtures/files/hello.txt"),
1111
options: {filename: 'test/fixtures/files/hello.txt', contentType: 'text/plain'}
1212
}
1313
}

0 commit comments

Comments
 (0)