diff --git a/README.md b/README.md index 4ee511e2..4739514d 100644 --- a/README.md +++ b/README.md @@ -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: { + } }) ``` diff --git a/index.js b/index.js index 0de68943..c2503577 100644 --- a/index.js +++ b/index.js @@ -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) { diff --git a/package.json b/package.json index 7120a48e..a5777f05 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/http-global-agent.js b/test/http-global-agent.js index c059aff9..3f6c674f 100644 --- a/test/http-global-agent.js +++ b/test/http-global-agent.js @@ -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) => { diff --git a/test/https-global-agent.js b/test/https-global-agent.js index 83c719c4..4740640c 100644 --- a/test/https-global-agent.js +++ b/test/https-global-agent.js @@ -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) => {