cloudflare-rs
cloudflare-rs copied to clipboard
After serialization of request payload bytes, verify payload size is <100MB
There are certain API endpoints on the Cloudflare API that allow users to send large payloads (e.g. the Workers KV bulk upload endpoint).
The API gateway will block any payloads over 100MB in size: this means we get an APIFailure
like Error(413, ApiErrors { other: {}, errors: [] })
. I think it could be worth introducing a general request validator function that checks for things like appropriate payload size, given that this will affect all API requests.
cc @ashleymichal
@gabbifish I am trying to learn rust. Would you all accept a PR for this issue? Wanted to confirm before I spent time on it.
@geota Go for it!! I'd be happy to provide PR review :)