| Summary: | MultiPartFilter does not record the content-type of uploaded files | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Yaytay <jim-eclipsebugs> |
| Component: | server | Assignee: | Jan Bartel <janb> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | janb, jetty-inbox, mgorovoy, tbecker |
| Version: | unspecified | ||
| Target Milestone: | 7.2.x | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Yaytay
Greg, could you please review this request? Yaytay, Just FYI, the Servlet 3.0 spec provides an API to retrieve the content-type of multipart mime requests, javax.servlet.http.Part. Jetty-8 implements the Servlet 3.0 spec. Jan This would be reasonable functionality to add, but a fairly low priority as servlet 3.0 already solves this. Patches welcome to help hurry up a fix, else we will look at this as best we can Parsing the content-types for each boundary in MultipartFilter.doFilter() is pretty easy. However I've no idea how to expose that to the client as we can't change the method signature for a javax.servlet.Filter. Instance variables are not an option here as it's not threadsafe. As this info is available in servlet 3.x, I won't spend any more time on this for now unless someone has a good suggestion for me. The content type can be retrieved as the request parameter:
name+".org.eclipse.jetty.servlet.contentType"
eg given:
Content-Disposition: form-data; name="fileup"; filename="test.upload"
Content-Type: application/octet-stream
then
request.getParameter("fileup.org.eclipse.jetty.servlet.contentType") returns "application/octet-stream"
Fixed for jetty-7.5.5.
|