Skip to content
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

Request.getPart() that results in Exception still allows other parts to be fetched. #82

Closed
joakime opened this issue Feb 16, 2016 · 2 comments
Assignees
Milestone

Comments

@joakime
Copy link
Contributor

joakime commented Feb 16, 2016

Seen in comment on stackoverflow http://stackoverflow.com/questions/35413971/spring-boot-jetty-catch-upload-error-file-too-big

I'm not certain, but I think this may be a bug in Jetty. With Tomcat, a MultipartException is thrown by Spring MVC from within DispatcherServlet.checkMultipart. This method accesses all of the request's parts. Tomcat throws an exception when one of the parts is too big, triggering the MultipartException. Jetty, on the other hand, allows Spring MVC to retrieve all of the request parts, even when one of them exceeds the maximum size. It then fails later on when a second attempt is made to access the request's parts but it's too late for Spring MVC to throw a MultipartException.

This seems like it might be a behavioral bug.

@janbartel
Copy link
Contributor

I made some comments over on issue #81 that are relevant here.

Note that jetty is never going to throw the spring MultipartException, however we could throw the spec-compliant IOException or ServletException.

janbartel added a commit that referenced this issue Feb 16, 2016
…load part is too big

Issue #82 Request.getPart() that results in Exception still allows other parts to be fetched
@janbartel
Copy link
Contributor

Assuming my understanding of the issue is correct as per comments on #81, I've pushed a fix to the jetty-9.3.x branch: 11d3448

If you'd like to test it out, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants