Skip to content

Commit

Permalink
refactor(server): apply additional changes to match busboy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Sep 5, 2023
1 parent 95ba0d9 commit 0286a65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ function parseMultipartForm (req, res, finishCb) {
const { filename } = info;
const currentFile = { size: 0 };

file.on('data', function (data) {
file.on('data', (data) => {
currentFile.name = filename;
currentFile.size += data.length;
});

file.on('close', function () {
file.on('close', () => {
files.file = currentFile;
});
});

bb.on('field', function (fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) {
fields[fieldname] = val;
bb.on('field', (name, val, info) => {
fields[name] = val;
});

bb.on('close', function () {
bb.on('close', () => {
console.log(stringify({ fields, files }));

// This is needed due to this bug: https://github.com/mscdex/busboy/issues/73
Expand Down

0 comments on commit 0286a65

Please sign in to comment.