]> granicus.if.org Git - apache/commitdiff
+ *) mod_dir: Prevent the internal identifier "httpd/unix-directory" from
authorEric Covener <covener@apache.org>
Wed, 12 Aug 2015 17:35:47 +0000 (17:35 +0000)
committerEric Covener <covener@apache.org>
Wed, 12 Aug 2015 17:35:47 +0000 (17:35 +0000)
+     appearing as a Content-Type response header when requests for a directory
+     are rewritten by mod_rewrite. [Eric Covener]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1695583 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/mappers/mod_dir.c

diff --git a/CHANGES b/CHANGES
index f49e42b03d7670fc30230d97b0d96cfa14b7b18c..b422730966185e93ddc547fb7a3667e25abe6413 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) 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]
+
   *) mod_rewrite:  Allow cookies set by mod_rewrite to contain ':' by accepting
      ';' as an alternate separator.  PR47241. 
      [<bugzilla schermesser com>, Eric Covener]
index d2d075d98b3db26746ef668168a76f9dff255562..25e223c3372ae20cc330e926620e317438e40a03 100644 (file)
@@ -279,11 +279,19 @@ static int fixup_dir(request_rec *r)
     }
 
     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;
     }
 
     /* 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;
     }