From 098a3d64cdc4243b8bc0b2a69dd157b852cf464e Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 12 Aug 2015 17:35:47 +0000 Subject: [PATCH] + *) 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] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1695583 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/mappers/mod_dir.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGES b/CHANGES index f49e42b03d..b422730966 100644 --- 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. [, Eric Covener] diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index d2d075d98b..25e223c337 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -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; }