]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
don't search for directory indexes/directoryslashes if a URL is in the
authorEric Covener <covener@apache.org>
Mon, 13 Jan 2014 01:51:58 +0000 (01:51 +0000)
committerEric Covener <covener@apache.org>
Mon, 13 Jan 2014 01:51:58 +0000 (01:51 +0000)
middle of being rewritten [in per-dir context]. PR53929

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

CHANGES
include/ap_mmn.h
modules/mappers/mod_dir.c
modules/mappers/mod_rewrite.c
modules/mappers/mod_rewrite.h

diff --git a/CHANGES b/CHANGES
index bd99d4295c34400d037ab3da0a0860683d6ca945..686900cd285f2d050cd1ba49535f295717ef7db2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.5.0
 
 
+  *) mod_dir: Don't search for a DirectoryIndex or DirectorySlash on a URL
+     that was just rewritten by mod_rewrite. PR53929. [Eric Covener]
+
   *) mod_dir: Add DirectoryCheckHandler to allow a 2.2-like behavior, skipping 
      execution when a handler is already set. PR53929. [Eric Covener]
 
index 0ba05f90fbca36a915dedf2eb4ace3f33146cbdb..ba4034e631fc159c752a1664ada7caefe08b8f2d 100644 (file)
  * 20131112.1 (2.5.0-dev)  Add suspend_connection and resume_connection hooks
  * 20131112.2 (2.5.0-dev)  Add ap_regname
  * 20131230.0 (2.5.0-dev)  cl_head_zero & expect_strict added to server_config
+ * 20131230.1 (2.5.0-dev)  REDIRECT_HANDLER_NAME in mod_rewrite.h
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20131230
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 0                  /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1                  /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index a309a983900b9210ebac1e75cdc3ead3ab443215..e0047ecf75f1c7c725b0d7337452e3df5f118cc4 100644 (file)
@@ -29,6 +29,7 @@
 #include "http_log.h"
 #include "http_main.h"
 #include "util_script.h"
+#include "mod_rewrite.h"
 
 module AP_MODULE_DECLARE_DATA dir_module;
 
@@ -277,6 +278,11 @@ static int fixup_dir(request_rec *r)
         return DECLINED;
     }
 
+    /* we're running between mod_rewrites fixup and its internal redirect handler, step aside */
+    if (!strcmp(r->handler, REDIRECT_HANDLER_NAME)) { 
+        return DECLINED;
+    }
+
     if (d->index_names) {
         names_ptr = (char **)d->index_names->elts;
         num_names = d->index_names->nelts;
index 1f1203edf9e4bb7130bafa8886bcfde85ec305c7..5e0d9183c9be2cc7c17834f5d23520bd3accfb19 100644 (file)
@@ -5027,7 +5027,7 @@ static int hook_fixup(request_rec *r)
             rewritelog((r, 1, dconf->directory, "internal redirect with %s "
                         "[INTERNAL REDIRECT]", r->filename));
             r->filename = apr_pstrcat(r->pool, "redirect:", r->filename, NULL);
-            r->handler = "redirect-handler";
+            r->handler = REDIRECT_HANDLER_NAME;
             return OK;
         }
     }
@@ -5073,7 +5073,7 @@ static int hook_mimetype(request_rec *r)
  */
 static int handler_redirect(request_rec *r)
 {
-    if (strcmp(r->handler, "redirect-handler")) {
+    if (strcmp(r->handler, REDIRECT_HANDLER_NAME)) {
         return DECLINED;
     }
 
index 040baeeac1a6d87f7eaf085e2d597877d48e8924..25d2e9a23b7ccba908c1368d02c60f5a5f1aa5d2 100644 (file)
@@ -29,6 +29,8 @@
 #include "apr_optional.h"
 #include "httpd.h"
 
+#define REDIRECT_HANDLER_NAME "redirect-handler"
+
 /* rewrite map function prototype */
 typedef char *(rewrite_mapfunc_t)(request_rec *r, char *key);