Configure maximum request body size SvelteKit | HTTP 413

Hello, is there a way to configure the accepted size of a request's body. I am currently trying to call an endpoint with a 500kb body and I get a 413 HTTP error with the message:"Invalid request body" . There are no logs in the apps "Deploy logs". I am using sveltekit with a railway.json configuration (no Dockerfile).
Solution:
Hi @jtmaveryk thanks for the answer. Fortunately I found a one line solution. It is to add BODY_SIZE_LIMIT to the Railway App Variables and configure it to something >500kb . Its explained here: https://kit.svelte.dev/docs/adapter-node#environment-variables-body-size-limit
SvelteKit docs
Node servers • SvelteKit documentation
Jump to solution
6 Replies
Percy
Percy2y ago
Project ID: N/A
Slaven
SlavenOP2y ago
N/A
Solution
Slaven
Slaven2y ago
Hi @jtmaveryk thanks for the answer. Fortunately I found a one line solution. It is to add BODY_SIZE_LIMIT to the Railway App Variables and configure it to something >500kb . Its explained here: https://kit.svelte.dev/docs/adapter-node#environment-variables-body-size-limit
SvelteKit docs
Node servers • SvelteKit documentation
Brody
Brody2y ago
we greatly appreciate your efforts to help but unfortunately this answers gets some things wrong, and in the interest of providing the most accurate help we can, I've had to remove this answer, but we hope you can continue helping people in the future!
Jack
Jack2y ago
My apologies, I’m sorry about that!
Brody
Brody2y ago
no worries! thank you for wanting to help we appreciate it 🙂
Want results from more Discord servers?
Add your server