From: Eric Covener Date: Fri, 28 Aug 2015 17:54:29 +0000 (+0000) Subject: backport http://svn.apache.org/r1695583 from trunk: X-Git-Tag: 2.4.17~173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afb5464db529b3ace56fbc79d6e0231b1b89fb35;p=apache backport http://svn.apache.org/r1695583 from trunk: 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 --- diff --git a/CHANGES b/CHANGES index dfca57ba11..f2e8b621e7 100644 --- 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 316aafb954..ae548df587 100644 --- 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 ] diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 542236b54f..50cef26ec8 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -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; }