-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: support FormData
#286
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: KaKa <23028015+climba03003@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work! Can you add a test for Node v14 and v16?
// supports >= node@18 | ||
runFormDataUnitTest('native', { FormData: globalThis.FormData, Blob: globalThis.Blob }) | ||
// supports >= node@16 | ||
runFormDataUnitTest('undici', { FormData: require('undici').FormData, Blob: require('node:buffer').Blob }) | ||
// supports >= node@14 | ||
runFormDataUnitTest('formdata-node', { FormData: require('formdata-node').FormData, Blob: require('formdata-node').Blob }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage should be fine for all supported node version.
undici
only supports FormData
higher than node@16
.
So, we need formdata-node
for node@14
.
It also show that we are not limited to undici
implementation only, but support all spec compliance FormData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Support FormData and provide the
Content-Type
header automatically.Closes fastify/fastify-multipart#516
Closes fastify/help#1017
Checklist
npm run test
andnpm run benchmark
and the Code of conduct