-
Notifications
You must be signed in to change notification settings - Fork 260
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
Middleware doesn't prevent execution main function when file too large #238
Comments
I'm not the author but looking at the code you can see that the abortOnLimit is going to send a status, which would conflict with your response and end up with the message you are seeing:
|
So then it should call the next function after error handler function |
I am also facing this problem. The response code of 413 is being sent; however, the next piece of middleware is being called. This seems to happen when files being uploaded are very close to the maximum upload size. The file |
Also allowed limitHandler and abortOnLimit to exist simultaneously without headers already sent error. Solves richardgirges#238.
I guess the issue is somehow tied to sending files with speeds close to reading from disk. Anyway, should be fixed with PR. |
any updates on this? |
I'm having the same issue, any solution or workaround? |
Check my PR #254 just above, it should still work |
Fixed in 1.4.2 |
I getting errors like
Cannot set headers after they are sent to the client
from UploadFile function because limitHandler function has been called and responce already sent to client. How to prevent it or it's bug?The text was updated successfully, but these errors were encountered: