Hypercorn - AsyncioWSGIMiddleware

268 views Asked by At

I couldn't find a way to limit request body size (POST with json body) on Gunicorn/Uvicorn/Hypercorn (using Starlette), and I didn't find anything that suggests it's possible. Is it, by any chance?

1

There are 1 answers

0
pgjones On

Limiting the request body size is typically done by the ASGI framework rather than the ASGI server, as explained in the Hypercorn docs. Quart, an ASGI framework, provides this method as discussed here. However, Starlette, another ASGI framework, doesn't provide a method directly, see this issue, instead you can use some ASGI middleware like this one to do so.