Upload limit is ignored
I have set max_content_length = "50MB", but whenever I upload a file larger than 50MB, the entire file is uploaded and only then I get the error message that the limit is exceeded.
rpaste
https://github.com/user-attachments/assets/a4c88e80-980b-4614-89dd-a679aca1ab91
curl
https://github.com/user-attachments/assets/b427758e-57b1-4d94-ae15-3e14bc75de44
The middleware was implemented in #53 and yes, it turns out it is broken. I just reproduced this issue.
What would be the way of going forward with fixing this? Should we check HEAD requests, or do something in the middleware? Any ideas?
What would be the way of going forward with fixing this?
At one point I read a comment (but I am not sure in which repo or issue/discussion) that there is now a native way with the new versions of actix and/or actix-multipart which should render the middleware obsolete.
I've been looking for that comment frantically, but unfortunately haven't found it yet.
It would be the best way of moving forward if something like that exists. Custom implementations are not always infallible, like we saw in this case :D
I think I found it: https://stackoverflow.com/a/78399675
That's superb, can you try it out?
One thing to note that we probably won't be able to change this on the fly since it's configured while the App is constructed.
Not sure when I get to it, but yes, I would like to.
I tried it, but unfortunately no difference. Maybe there's an issue with the Byte arithmetic. I am quite puzzled by this.
When I get to it, I'll open a draft PR and you can have a look at my attempt to make it woek with the "new" way of doing it according to the stackoverflow comment. Maybe I fucked it up though...
Yup, shoot me a draft whenever you can!
This (#360) was supposed to work, but it doesn't. I am not sure how to solve this. I can't believe nobody ever got this to work.
We both seem quite puzzled by this. Maybe a gentle ping to the actix master @robjtede would help us out a bit 😊