fix(middleware-multipart): replaced buboy with
MODIFY
packages/middleware-multipart/package.json
packages/middleware-multipart/package.json
},
"homepage": "https://github.com/marblejs/marble#readme",
"dependencies": {
- "@types/busboy": "^0.2.3",
- "busboy": "~0.3.1"
+ "@fastify/busboy": "^1.0.0"
},
"peerDependencies": {
"@marblejs/core": "^4.0.0",

MODIFY
packages/middleware-multipart/src/multipart.parser.ts
packages/middleware-multipart/src/multipart.parser.ts
-import * as Busboy from 'busboy';
+import * as Busboy from '@fastify/busboy';
import { HttpRequest, HttpError, HttpStatus, isHttpError } from '@marblejs/http';
import { fromEvent, Observable, throwError, forkJoin } from 'rxjs';
import { mapTo, mergeMap, takeUntil, catchError, share, defaultIfEmpty } from 'rxjs/operators';
@@ -7,8 +7,8 @@ import { parseField, FieldEvent } from './multipart.parser.field';
import { parseFile, FileEvent } from './multipart.parser.file';
export const parseMultipart = (opts: ParserOpts) => (req: HttpRequest): Observable<HttpRequest> => {
- const busboy = new Busboy({
- headers: req.headers,
+ const busboy = new Busboy.Busboy({
+ headers: req.headers as Busboy.BusboyHeaders,
limits: {
fileSize: opts.maxFileSize,
files: opts.maxFileCount,

MODIFY
yarn.lock
yarn.lock
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
+"@fastify/busboy@^1.0.0":
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-1.0.0.tgz#f73182e61955ab91f8ec5a137fda2c9cee366dbd"
+ integrity sha512-tzTXX1TFEjWCseEsNdIlXXkD+48uJoN+zpqIojUX4pSoMscsbhO/UuVEB5SzJucexqDWOo2ma0ECwdD7hZdrzg==
+ dependencies:
+ text-decoding "^1.0.0"
+
"@gar/promisify@^1.0.1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.27.tgz#61eb4d75dc6bfbce51cf49ee9bbebe941b2cb5d0"
integrity sha512-6BmYWSBea18+tSjjSC3QIyV93ZKAeNWGM7R6aYt1ryTZXrlHF+QLV0G2yV0viEGVyRkyQsWfMoJ0k/YghBX5sQ==
-"@types/busboy@^0.2.3":
- version "0.2.3"
- resolved "https://registry.yarnpkg.com/@types/busboy/-/busboy-0.2.3.tgz#6697ad29873246c530f09a3ff5a40861824230d5"
- integrity sha1-ZpetKYcyRsUw8Jo/9aQIYYJCMNU=
- dependencies:
- "@types/node" "*"
-
"@types/chalk@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@types/chalk/-/chalk-2.2.0.tgz#b7f6e446f4511029ee8e3f43075fb5b73fbaa0ba"
@@ -2708,13 +2708,6 @@ builtins@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
-busboy@~0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.3.1.tgz#170899274c5bf38aae27d5c62b71268cd585fd1b"
- integrity sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==
- dependencies:
- dicer "0.3.0"
-
byline@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1"
@@ -3452,13 +3445,6 @@ dezalgo@^1.0.0:
asap "^2.0.0"
wrappy "1"
-dicer@0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.3.0.tgz#eacd98b3bfbf92e8ab5c2fdb71aaac44bb06b872"
- integrity sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA==
- dependencies:
- streamsearch "0.1.2"
-
diff-sequences@^27.0.6:
version "27.0.6"
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723"
@@ -7582,11 +7568,6 @@ stack-utils@^2.0.3:
dependencies:
escape-string-regexp "^2.0.0"
-streamsearch@0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
- integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=
-
string-length@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1"
@@ -7871,6 +7852,11 @@ test-exclude@^6.0.0:
glob "^7.1.4"
minimatch "^3.0.4"
+text-decoding@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/text-decoding/-/text-decoding-1.0.0.tgz#38a5692d23b5c2b12942d6e245599cb58b1bc52f"
+ integrity sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA==
+
text-extensions@^1.0.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26"

fix(middleware-multipart): replaced buboy with @fastify/busboy