Bug 45995

Summary: RFE - MIME type extension not case sensitive
Product: Tomcat 6 Reporter: Vitor Swaid <vitor.swaid>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement CC: tbain, vitor.swaid
Priority: P5    
Version: unspecified   
Target Milestone: default   
Hardware: All   
OS: All   

Description Vitor Swaid 2008-10-13 04:32:38 UTC

On the dev-tomcat list I described in the topic "Byte Serving and PDFs with the DefaultServlet" an issue that I had with Tomcat to serve PDFs.

Analysing the answers I could find that the matter was related to the case of the file extension. Today Tomcat is case sensitive for MIME type extensions.

So the solution for me was enter two MIME specifications on the web.xml file. One is for "pdf" and another one for "PDF".

This way I would like to ask for and request for enhancement to make Tomcat be able to, due a setup on configuration file, consider or not case for MIME type extensions.


Comment 1 Konstantin Kolinko 2009-01-02 08:59:04 UTC
For reference:
In Apache HTTPD as of current 1.3 and 2.2 versions, the mime mappings are case-insensitive.


esp. see the AddType and TypesConfig directives
Comment 2 Mark Thomas 2012-07-02 09:44:06 UTC
Fixed in trunk for Tomcat 8 onwards. From Tomcat 8, Tomcat will align with httpd and use a case-insensitive comparison.

There hasn't been much demand for this feature in the current Tomcat releases so I do not propose to back-port it since:
- changing behaviour for stable releases may cause problems for existing applications
- making it configurable adds unnecessary complexity

If demand does appear, then this can be back-ported but it would need to be configurable.