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
Parse multipart/form-data before it enters the servlet #182
Comments
|
Any progress here? Apache MyFaces Tobago uses Commons Fileupload. However it seems that Jetty only allows Servlet API 3.x and we can no longer use Commons Fileupload?! java.io.IOException: Missing content for multipart request |
|
@deki, so the client sends crap data and Jetty throws an exception; perhaps it's the client that should be fixed ? We will happily analyze the issue if we had a reproducible test case. You can attach it to this issue. We also accept contributions, see https://www.eclipse.org/jetty/documentation/9.3.x/contributing-patches.html. Thanks ! |
|
@deki What version of Jetty? and what version of commons-fileupload? For troubleshooting, alternatively, you can capture the raw commons-fileupload produced content and provide it for this issue. |
|
@joakime Jetty 9.3.13.v20161014, Commons Fileupload 1.3.2 It's reproducible using the Tobago demo with the following steps:
As far as I can see the issue and possible solutions were already discussed in #240. I'm happy to contribute, just let me know which one is the preferred solution. @sbordet it's not related to crap data, the same example is working with Tomcat. |
|
@deki - working in tomcat doesn't necessarily mean compliance with the RFCs and specifications. My understanding of this issue is that both the tobago filter and something annotated with @MultiPartConfig are expecting to read/parse the multipart data. In this case, it might just be that tomcat is more forgiving of missing content if something else has consumed it. Anyway, we do need to look at this in more detail to work out exactly what is happening. However, you could expedite the process by having a little deeper look - what is annotated with @MultiPartConfig? who is calling getParameterNames and are they expecting the parts to be in those names? Did the filter read the content? |
|
@deki The problem seems to be that Tobago has its own multipart filter processing that I believe is going to clash with the @MultipartConfig annotation that I believe is on the FacesServlet (but please check the src for FacesServlet of the version you are using to confirm that). As I can see from the Tobago code, there is a TobagoMultipartFormdataFilter configured in web.xml. That filter wraps the inbound request into a TobagoMultipartFormdataRequest, which in its initialization looks like it reads all of the content from the request and does its own multipart parsing. Thus, by the time that jetty needs to honour the @MultipartConfig annotation on the FacesServlet, there is no content for us to read. Very difficult for us to tell whether that is because the request is really missing content or some other part of the webapp gobbled up all of the input first. The only thing I can think of at the moment is for jetty to log the exception but not throw an error: I assume that tomcat is ignoring the lack of content for it to parse for the @MultipartConfig too. |
|
@janbartel thanks for the fix. We already solved the conflict in Tobago 3.x. For Tobago 2.x we can't really fix it as the user can use e.g. a JSF 2.0.x implementation without @MultipartConfig annotation on FacesServlet whereas a JSF 2.2.x implementation has the annotation. |
migrated from Bugzilla #458126
status ASSIGNED severity normal in component server for 9.2.x
Reported in version 9.3.0 on platform All
Assigned to: Jan Bartel
On 2015-01-22 07:18:16 -0500, Jan Bartel wrote:
On 2015-01-22 09:39:13 -0500, Bill Mair wrote:
The text was updated successfully, but these errors were encountered: