R
Railway13mo ago
Slaven

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
Percy13mo ago
Project ID: N/A
Slaven
Slaven13mo ago
N/A
Solution
Slaven
Slaven13mo 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
Brody13mo 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
Jack13mo ago
My apologies, I’m sorry about that!
Brody
Brody13mo ago
no worries! thank you for wanting to help we appreciate it 🙂