Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update busboy to v1.6.0 #855

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/routes/gridfs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const _ = require('lodash');
const Busboy = require('busboy');
const busboy = require('busboy');
const GridFSStream = require('gridfs-stream');
const mongo = require('mongodb');
const utils = require('../utils');
Expand Down Expand Up @@ -45,7 +45,7 @@ const routes = function () {

// upload a file
exp.addFile = function (req, res) {
const busboy = new Busboy({ headers: req.headers });
busboy({ headers: req.headers });
const newFileID = new mongo.ObjectId();

// Override the bucket name with what is currently selected
Expand All @@ -54,7 +54,7 @@ const routes = function () {

const gfs = new GridFSStream(req.db, mongo);

busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
busboy.on('file', function (fieldname, file, filename, info) {
if (!filename) {
req.session.error = 'No filename.';
return res.redirect('back');
Expand All @@ -64,10 +64,10 @@ const routes = function () {
_id: newFileID,
filename,
mode: 'w',
content_type: mimetype,
content_type: info.mimetype,
});
file.pipe(writeStream);
}).on('finish', function () {
}).on('close', function () {
req.session.success = 'File uploaded!';

setTimeout(function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"bluebird": "^3.7.2",
"body-parser": "^1.18.3",
"bson": "^4.2.0",
"busboy": "^0.2.13",
"busboy": "^1.6.0",
"cli-color": "^2.0.0",
"commander": "^2.9.0",
"cookie-parser": "1.4.4",
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1616,14 +1616,21 @@ buffer@^5.6.0:
base64-js "^1.3.1"
ieee754 "^1.1.13"

busboy@^0.2.13, busboy@^0.2.14:
busboy@^0.2.14:
version "0.2.14"
resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.2.14.tgz#6c2a622efcf47c57bbbe1e2a9c37ad36c7925453"
integrity sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=
dependencies:
dicer "0.2.5"
readable-stream "1.1.x"

busboy@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==
dependencies:
streamsearch "^1.1.0"

bytes@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
Expand Down Expand Up @@ -5195,6 +5202,11 @@ streamsearch@0.1.2:
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=

streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==

string-width@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
Expand Down