You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2009/10/03 14:13:42 UTC

svn commit: r821298 - in /httpd/httpd/trunk: CHANGES modules/http/mod_mime.c

Author: sf
Date: Sat Oct  3 12:13:41 2009
New Revision: 821298

URL: http://svn.apache.org/viewvc?rev=821298&view=rev
Log:
Make RemoveType override the info from TypesConfig

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/http/mod_mime.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=821298&r1=821297&r2=821298&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Oct  3 12:13:41 2009
@@ -10,6 +10,9 @@
      mod_proxy_ftp: NULL pointer dereference on error paths.
      [Stefan Fritsch <sf fritsch.de>, Joe Orton]
 
+  *) mod_mime: Make RemoveType override the info from TypesConfig.
+     PR 38330. [Stefan Fritsch]
+
   *) mod_cache: Introduce the option to run the cache from within the
      normal request handler, and to allow fine grained control over
      where in the filter chain content is cached. [Graham Leggett]

Modified: httpd/httpd/trunk/modules/http/mod_mime.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/mod_mime.c?rev=821298&r1=821297&r2=821298&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/mod_mime.c (original)
+++ httpd/httpd/trunk/modules/http/mod_mime.c Sat Oct  3 12:13:41 2009
@@ -274,6 +274,16 @@
 }
 
 /*
+ * As RemoveType should also override the info from TypesConfig, we add an
+ * empty string as type instead of actually removing the type.
+ */
+static const char *remove_extension_type(cmd_parms *cmd, void *m_,
+                                         const char *ext)
+{
+    return add_extension_info(cmd, m_, "", ext);
+}
+
+/*
  * Note handler names are un-added with each per_dir_config merge.
  * This keeps the association from being inherited, but not
  * from being re-added at a subordinate level.
@@ -403,7 +413,7 @@
     AP_INIT_ITERATE("RemoveOutputFilter", remove_extension_info,
         (void *)APR_OFFSETOF(extension_info, output_filters), OR_FILEINFO,
         "one or more file extensions"),
-    AP_INIT_ITERATE("RemoveType", remove_extension_info,
+    AP_INIT_ITERATE("RemoveType", remove_extension_type,
         (void *)APR_OFFSETOF(extension_info, forced_type), OR_FILEINFO,
         "one or more file extensions"),
     AP_INIT_TAKE1("TypesConfig", set_types_config, NULL, RSRC_CONF,
@@ -819,7 +829,8 @@
 
         if (exinfo != NULL) {
 
-            if (exinfo->forced_type) {
+            /* empty string is treated as special case for RemoveType */
+            if (exinfo->forced_type && *exinfo->forced_type) {
                 ap_set_content_type(r, exinfo->forced_type);
                 found = 1;
             }