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:Jump to 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-limitSvelteKit docs
Node servers • SvelteKit documentation
6 Replies
Project ID:
N/A
N/A
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-limitSvelteKit docs
Node servers • SvelteKit documentation
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!
My apologies, I’m sorry about that!
no worries! thank you for wanting to help we appreciate it 🙂