-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting multer::Multipart constraints #1623
Comments
I am willing to work on implementing this, btw! |
The limit you're running into is most likely https://docs.rs/axum/latest/axum/extract/struct.DefaultBodyLimit.html. It has a method to disable the default limit. |
You're right, after implement the vendored Multipart extractor I've realized Constraints are an opt-in thing. Thanks for linking that, I'll look into it. Either way, it's probably not a bad idea to support these more specific constraints that multer exposes. |
Yeah I'm open to that. However its a bit tricky since extractors can't really be configured currently, as they're types in function arguments. So if you have If one really needs the constraints today then I'd probably just recommend writing their own extractor that uses multer. |
I've created a POC for how we could support this eventually, once rust-lang/rust#95174 is stable. |
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 supportsConstraints
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.
The text was updated successfully, but these errors were encountered: