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

Update documentation for multipart/form-data requests #33

Open
lorenzodejong opened this issue Aug 3, 2021 · 4 comments
Open

Update documentation for multipart/form-data requests #33

lorenzodejong opened this issue Aug 3, 2021 · 4 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@lorenzodejong
Copy link

Thanks for open sourcing this library, saved me quite some time while implementing my API proxy.

While working with multipart/form-data requests i've noticed that the Next.js bodyParser tries to parse the body, causing it to corrupt the binary content of all files in the request. Therefore (in my case) it's desired to disable the bodyParser entirely in the API route (https://nextjs.org/docs/api-routes/api-middlewares#custom-config).

export const config = {
	api: {
		bodyParser: false
	}
};

This library handles all other requests/content-types correctly. Perhaps it would be an idea to document this to safe others some time with similar issues.

@stegano stegano added documentation Improvements or additions to documentation good first issue Good for newcomers labels Aug 5, 2021
stegano added a commit that referenced this issue Aug 16, 2021
@stegano
Copy link
Owner

stegano commented Aug 16, 2021

Hi @lorenzodejong
Thanks for your opinion
Added to the README.md now! 😀

@all-contributors please add @lorenzodejong for doc

@allcontributors
Copy link
Contributor

@stegano

I've put up a pull request to add @lorenzodejong! 🎉

@lorenzodejong
Copy link
Author

Perfect, great improvement to the existing documentation!

@bellmatthewf
Copy link

bellmatthewf commented Sep 20, 2023

Does turning off the bodyParser cause any issues with other types of requests (what is it there for)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants