Bug 45995 - RFE - MIME type extension not case sensitive
Summary: RFE - MIME type extension not case sensitive
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: unspecified
Hardware: All All
: P5 enhancement with 1 vote (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2008-10-13 04:32 UTC by Vitor Swaid
Modified: 2012-07-02 09:44 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
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.