]> granicus.if.org Git - apache/commitdiff
do the redirection for GET requests only
authorGreg Stein <gstein@apache.org>
Sat, 24 Feb 2001 22:40:49 +0000 (22:40 +0000)
committerGreg Stein <gstein@apache.org>
Sat, 24 Feb 2001 22:40:49 +0000 (22:40 +0000)
Submitted by: Ryan Bloom and Greg Stein

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

modules/mappers/mod_dir.c

index 4c4be6223974f693501d233a3347cc54dc86452e..4368f097676cca5932d44a00304191c2675e87ee 100644 (file)
@@ -118,15 +118,11 @@ static void *merge_dir_configs(apr_pool_t *p, void *basev, void *addv)
 
 static int fixup_dir(request_rec *r)
 {
-    dir_config_rec *d;
-
-    if (r->finfo.filetype != APR_DIR) {
+    /* only (potentially) redirect for GET requests against directories */
+    if (r->method_number != M_GET || r->finfo.filetype != APR_DIR) {
        return DECLINED;
     }
 
-    d = (dir_config_rec *) ap_get_module_config(r->per_dir_config,
-                                               &dir_module);
-
     if (r->uri[0] == '\0' || r->uri[strlen(r->uri) - 1] != '/') {
         char *ifile;
         if (r->args != NULL)
@@ -140,6 +136,7 @@ static int fixup_dir(request_rec *r)
                   ap_construct_url(r->pool, ifile, r));
         return HTTP_MOVED_PERMANENTLY;
     }
+
     return OK;
 }