Skip to content

Commit

Permalink
feat(fastify#284): update multipart package min required version that…
Browse files Browse the repository at this point in the history
… introduced breaking change and implement CR
  • Loading branch information
codrin-ch committed Jan 28, 2023
1 parent 0bf4a4a commit d68df13
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ fastify.register(FastifyReplyFrom, {
base: 'http://localhost:3001/',
// http and https is allowed to use http.globalAgent or https.globalAgent
globalAgent: true,
undici: false
http: {
}
})
```

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function onErrorDefault (reply, { error }) {
}

function isFastifyMultipartRegistered (fastify) {
return fastify.hasContentTypeParser('multipart') && fastify.hasRequestDecorator('multipart')
return fastify.hasContentTypeParser('multipart/form-data') && fastify.hasRequestDecorator('multipart')
}

function createRequestRetry (requestImpl, reply, retriesCount, retryOnError, maxRetriesOn503) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
"homepage": "https://github.com/fastify/fastify-reply-from#readme",
"devDependencies": {
"@fastify/formbody": "^7.0.1",
"@fastify/multipart": "^7.1.0",
"@fastify/formbody": "^7.4.0",
"@fastify/multipart": "^7.4.0",
"@fastify/pre-commit": "^2.0.2",
"@sinonjs/fake-timers": "^10.0.0",
"@types/node": "^18.0.0",
Expand Down
3 changes: 2 additions & 1 deletion test/http-global-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ target.listen({ port: 0 }, (err) => {
instance.register(From, {
base: `http://localhost:${target.address().port}`,
globalAgent: true,
undici: false
http: {
}
})

instance.listen({ port: 0 }, (err) => {
Expand Down
3 changes: 2 additions & 1 deletion test/https-global-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ target.listen({ port: 0 }, (err) => {
instance.register(From, {
base: `https://localhost:${target.address().port}`,
globalAgent: true,
undici: false
http: {
}
})

instance.listen({ port: 0 }, (err) => {
Expand Down

0 comments on commit d68df13

Please sign in to comment.