Skip to content

Commit

Permalink
merge main to next
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Feb 23, 2024
2 parents 61fcbe7 + e2aaf59 commit 3f434e8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ yarn.lock
# editor files
.vscode
.idea

#tap files
.tap/
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,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.2.1",
"@fastify/busboy": "^2.1.0",
"@fastify/deepmerge": "^1.3.0",
"@fastify/error": "^3.4.1",
"fastify-plugin": "^4.5.1",
Expand Down

0 comments on commit 3f434e8

Please sign in to comment.