tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1356151 - in /tomcat/trunk: conf/web.xml java/org/apache/catalina/core/StandardContext.java webapps/docs/changelog.xml
Date Mon, 02 Jul 2012 09:41:24 GMT
Author: markt
Date: Mon Jul  2 09:41:23 2012
New Revision: 1356151

URL: http://svn.apache.org/viewvc?rev=1356151&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45995
Align Tomcat with Apache httpd and perform MIME type mapping based on file extension in a
case insensitive manner.

Modified:
    tomcat/trunk/conf/web.xml
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/conf/web.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/conf/web.xml?rev=1356151&r1=1356150&r2=1356151&view=diff
==============================================================================
--- tomcat/trunk/conf/web.xml (original)
+++ tomcat/trunk/conf/web.xml Mon Jul  2 09:41:23 2012
@@ -516,6 +516,7 @@
   <!-- based on these mappings.  Additional mappings can be added here (to  -->
   <!-- apply to all web applications), or in your own application's web.xml -->
   <!-- deployment descriptor.                                               -->
+  <!-- Note: Extensions are always matched in a case-insensitive manner.    -->
 
     <mime-mapping>
         <extension>123</extension>

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1356151&r1=1356150&r2=1356151&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Mon Jul  2 09:41:23 2012
@@ -2994,7 +2994,7 @@ public class StandardContext extends Con
     public void addMimeMapping(String extension, String mimeType) {
 
         synchronized (mimeMappings) {
-            mimeMappings.put(extension, mimeType);
+            mimeMappings.put(extension.toLowerCase(Locale.ENGLISH), mimeType);
         }
         fireContainerEvent("addMimeMapping", extension);
 
@@ -3502,7 +3502,7 @@ public class StandardContext extends Con
     @Override
     public String findMimeMapping(String extension) {
 
-        return (mimeMappings.get(extension));
+        return (mimeMappings.get(extension.toLowerCase(Locale.ENGLISH)));
 
     }
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1356151&r1=1356150&r2=1356151&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jul  2 09:41:23 2012
@@ -49,6 +49,10 @@
 <section name="Tomcat 8.0.0">
   <subsection name="Catalina">
     <changelog>
+      <add>
+        <bug>45995</bug>: Align Tomcat with Apache httpd and perform MIME type
+        mapping based on file extension in a case insensitive manner. (markt)
+      </add>
       <scode>
         Remove duplicate code that converted a Host&apos;s appBase attribute to
         a canonical file. (markt)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message