]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r821298 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 18 Dec 2009 14:10:56 +0000 (14:10 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 18 Dec 2009 14:10:56 +0000 (14:10 +0000)
Make RemoveType override the info from TypesConfig

Submitted by: sf
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@892258 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/http/mod_mime.c

diff --git a/CHANGES b/CHANGES
index a71324f3c2dace290f1b9afb6b85f99fa9e146f8..5d5d88c03241346d03b800b915c15c660af348a2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@ Changes with Apache 2.2.15
      control is still vulnerable, unless using OpenSSL >= 0.9.8l.  
      [Joe Orton, Ruediger Pluem]
 
+   *) mod_mime: Make RemoveType override the info from TypesConfig.
+      PR 38330. [Stefan Fritsch]
+
    *) Proxy: unable to connect to a backend is SERVICE_UNAVAILABLE,
       rather than BAD_GATEWAY or (especially) NOT_FOUND.
       PR 46971 [evanc nortel.com]
diff --git a/STATUS b/STATUS
index 22dd1e71cedd7473712c562d85d0aefa007ad9e3..a807febe851b6c61e35012952c8aed46ac84e947 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -87,12 +87,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * mod_mime: Make RemoveType override the info from TypesConfig
-    PR 38330.
-    Trunk Patch: http://svn.apache.org/viewvc?rev=821298&view=rev
-    2.2.x Patch: trunk patch works with some offset (except for CHANGES)
-    +1: sf, rpluem, rjung, jim
-
   * build: fix --with-module option to work as documented
     PR 43881
     Patch: http://svn.apache.org/viewvc?rev=880794&view=rev
index a801a0ca1d4a83f48e10d0ab62cac5828419cf1a..eed6ebd9b93b7dc27ee98bcdd0cfda700d036e87 100644 (file)
@@ -273,6 +273,16 @@ static const char *add_extension_info(cmd_parms *cmd, void *m_,
     return NULL;
 }
 
+/*
+ * 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
@@ -403,7 +413,7 @@ static const command_rec mime_cmds[] =
     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,
@@ -815,7 +825,8 @@ static int find_ct(request_rec *r)
 
         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;
             }