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
Spring MVC MultiPartException not thrown in Jetty as it is in Tomcat when upload part is too big #81
Comments
@joakime Thanks for opening this and #82.
It's not so much the Spring doesn't expect an IllegalStateException, but that the exception doesn't happen at the same time as it does when using Tomcat. Very early in the handling of a request, |
Related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455655 Jetty parses the multipart data either when one of the Request.getParameter/s() methods are called, or when Request.getParts() is called. If an exception happens during the parsing as a result of calling Request.getParameter/s() it was difficult to communicate that back to the client, due to the signature of getParameter/s(), so we added a throw of a RuntimeException to wrap the real exception. So to clarify, I expect the current behaviour for jetty to be:
So if I understand the bug report correctly, you're asking that if an exception occurs during multipart parsing, you want that exception returned every time getPart/s() is called? So that even if your code causes the parsing by calling getParameter/s() initially and the RuntimeException is thrown, your code is still likely to go on to call getPart/s() and you want the IOException or ServletException at that time, yes? |
…load part is too big Issue #82 Request.getPart() that results in Exception still allows other parts to be fetched
Assuming my understanding of the issue is correct as per my previous message, I've pushed a fix for this to the jetty-9.3.x branch: 11d3448 If you'd like to test it out, that would be great. |
The bug was reported against Jetty 9.2.x, can this fix be cherry-picked back to the jetty-9.2.x branch? |
@janbartel The latest 9.3.8 snapshot looks good. Thank you. The |
http://stackoverflow.com/questions/35413971/spring-boot-jetty-catch-upload-error-file-too-big
It seems that Spring's org.springframework.web.multipart.MultipartException is not thrown when running under Jetty, as it is on Tomcat.
In Jetty 9.2.14, we throw a IllegalStateException, which isn't what Spring is expecting.
The text was updated successfully, but these errors were encountered: