Skip to content

Commit

Permalink
use @fastify/busboy v2.1.0 (#506)
Browse files Browse the repository at this point in the history
* use busboy2

* busboy2
  • Loading branch information
gurgunday committed Jan 28, 2024
1 parent 2b4809e commit 8e4b5e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,16 @@ function fastifyMultipart (fastify, options, done) {
const parts = () => {
return new Promise((resolve, reject) => {
handle((val) => {
if (val instanceof Error) return reject(val)
resolve(val)
if (val instanceof Error) {
if (val.message === 'Unexpected end of multipart data') {
// Stop parsing without throwing an error
resolve(null)
} else {
reject(val)
}
} else {
resolve(val)
}
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "commonjs",
"types": "types/index.d.ts",
"dependencies": {
"@fastify/busboy": "^1.0.0",
"@fastify/busboy": "^2.1.0",
"@fastify/deepmerge": "^1.0.0",
"@fastify/error": "^3.0.0",
"fastify-plugin": "^4.0.0",
Expand Down

0 comments on commit 8e4b5e5

Please sign in to comment.