]> granicus.if.org Git - apache/commitdiff
backport http://svn.apache.org/r1695583 from trunk:
authorEric Covener <covener@apache.org>
Fri, 28 Aug 2015 17:54:29 +0000 (17:54 +0000)
committerEric Covener <covener@apache.org>
Fri, 28 Aug 2015 17:54:29 +0000 (17:54 +0000)
mod_dir: when we bail out of fixups, make sure Content-Type is not still
httpd/unix-directory.  This only happens when the generator sets
no content-type which is more common w/ no DefaultType in 2.4.

Submitted By: covener
Reviewed By: ylavic, niq

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

CHANGES
STATUS
modules/mappers/mod_dir.c

diff --git a/CHANGES b/CHANGES
index dfca57ba1186751bb4c6819c4403a58e31138ecb..f2e8b621e78e81b826980ab1212cc2a59b1bedf8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.17
 
+  *) mod_dir: Prevent the internal identifier "httpd/unix-directory" from
+     appearing as a Content-Type response header when requests for a directory
+     are rewritten by mod_rewrite. [Eric Covener]
 
 Changes with Apache 2.4.16
 
diff --git a/STATUS b/STATUS
index 316aafb9548f36b7bac65d3455292c39b2b696dd..ae548df5871b23914a71892453bda7f76192822d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -125,13 +125,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      +1: jailletc36, ylavic, niq
      jailletc36: A CHANGE entry should be added. I forgot it :(
 
-   *) mod_dir: when we bail out of fixups, make sure Content-Type is not still
-               httpd/unix-directory.  This only happens when the generator sets
-               no content-type which is more common w/ no DefaultType in 2.4.
-      trunk: http://svn.apache.org/r1695583
-      2.4.x: trunk works
-     +1: covener, ylavic, niq
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 542236b54f42c248f33baaf808e2cb700b545a53..50cef26ec8cd7ce8c0c12256fab2d5ba7e23e724 100644 (file)
@@ -276,10 +276,18 @@ static int fixup_dir(request_rec *r)
 
     /* we're running between mod_rewrites fixup and its internal redirect handler, step aside */
     if (!strcmp(r->handler, REWRITE_REDIRECT_HANDLER_NAME)) { 
+        /* Prevent DIR_MAGIC_TYPE from leaking out when someone has taken over */
+        if (!strcmp(r->content_type, DIR_MAGIC_TYPE)) { 
+            r->content_type = NULL;
+        }
         return DECLINED;
     }
 
     if (d->checkhandler == MODDIR_ON && strcmp(r->handler, DIR_MAGIC_TYPE)) {
+        /* Prevent DIR_MAGIC_TYPE from leaking out when someone has taken over */
+        if (!strcmp(r->content_type, DIR_MAGIC_TYPE)) { 
+            r->content_type = NULL;
+        }
         return DECLINED;
     }