Skip to content

Commit

Permalink
fix: out of date regex that was causing readstreams to be stringified
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Aug 6, 2020
1 parent 731d664 commit 89177c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/targets/node/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = function (source, options) {
.push('});')
.blank()

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

module.exports.info = {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/node/request/multipart-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var options = {
headers: {'content-type': 'multipart/form-data; boundary=---011000010111000001101001'},
formData: {
foo: {
value: 'fs.createReadStream("test/fixtures/files/hello.txt")',
value: fs.createReadStream("test/fixtures/files/hello.txt"),
options: {filename: 'test/fixtures/files/hello.txt', contentType: 'text/plain'}
}
}
Expand Down

0 comments on commit 89177c3

Please sign in to comment.