Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate out of deprecated API. #289

Closed
2 tasks done
climba03003 opened this issue Oct 31, 2021 · 0 comments · Fixed by #465 or #481
Closed
2 tasks done

migrate out of deprecated API. #289

climba03003 opened this issue Oct 31, 2021 · 0 comments · Fixed by #465 or #481
Labels
good first issue Good for newcomers

Comments

@climba03003
Copy link
Member

climba03003 commented Oct 31, 2021

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.x.x

Plugin version

No response

Node.js version

14.x

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

20.04

Description

Migrate out of deprecated API.

const mp = req.multipart((field, file, filename, encoding, mimetype) => {
body[field] = body[field] || []
body[field].push({
data: [],
filename,
encoding,
mimetype,
limit: false
})

request.multipart is actually deprecated, it should not be used inside this plugin.

Reported by Jones on Discord Server.

Steps to Reproduce

Register the plugin with addToBody.

fastify.register(multipart, {
  addToBody: true,
});

Expected Behavior

No deprecation warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
1 participant