axum
axum copied to clipboard
Allow setting multer::Multipart constraints
Feature Request
Motivation
I'm running into a length limit exceeded
error from multer when trying to read a file coming in from a Multipart form. Multer supports Constraints
to avoid this, but axum's multipart extractor does not allow forwarding these.
Proposal
I'm not super sure how this could be implemented, since the constraints can't be passed through the parameter typing. Either there might need to be some documented recommended way of parsing the request manually inside the handler, or maybe the multipart extractor needs to be a bit fancier to allow passing constraints.
Alternatives
For now, I'll "vendor" the Multipart extractor, since it seems simple enough, to add that functionality, but it seems like something axum's native extractor should support.