-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
monkey-patch formData to enable multipart parsing #5292
Conversation
🦋 Changeset detectedLatest commit: f90cd1a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hmm. Looks like this might only work on Node 18 for some reason. Maybe the polyfill isn't working on Node 16 as expected? |
Very weird that the |
Ok, so it was failing in CI because for some reason I don't fully understand some polyfills were being applied and some weren't, which led to an |
This is an alternative to reverting #5117 (#5290). It's ugly, but we can use the multipart form data parsing in
node-fetch
by monkey-patching theundici
Request
object'sformData
method to construct anode-fetch
Request
with the raw data and callformData
on that.Hideous, but it works. If nodejs/undici#974 is resolved, we can remove this hack.
Marking as draft for now as it should really have a test.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0