]> granicus.if.org Git - apache/commitdiff
Allow CGI scripts that use POST and mod_dav to exist in the same location.
authorRyan Bloom <rbb@apache.org>
Mon, 30 Sep 2002 05:10:07 +0000 (05:10 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 30 Sep 2002 05:10:07 +0000 (05:10 +0000)
Mod_Dav was always setting the r->handler field to "dav_handler", but
this means that mod_cgi won't run the script.  According to my reading
of the DAV RFC, mod_dav shouldn't do anything at all with a POST request,
because it is impossible to know if the POST was meant for DAV or for some
other resource.  We used to excuse POST from DAV processing, so I have
re-enabled that behavior.

PR: 13025

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

CHANGES
modules/dav/main/mod_dav.c

diff --git a/CHANGES b/CHANGES
index d4afb23b782887429ec07dfe25d16a97b3c291e3..1ce2ddc7607ba568609398343d2061e7f7e33a11 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.43
 
+  *) Allow POST requests and CGI scripts to work when DAV is enabled
+     on the location.  [Ryan Bloom]
+
   *) Allow the UserDir directive to accept a list of directories.
      This matches what Apache 1.3 does.  Also add documentation for
      this feature. [Jay Ball <jay@veggiespam.com>]
index 24f63e351fdf05d34a4f06716f525060e7b52a7e..707fed3760d89f78910be3ea743215195f6a9811 100644 (file)
@@ -4633,10 +4633,20 @@ static int dav_fixups(request_rec *r)
         }
     }
 
-    /* We are going to be handling the response for this resource. */
-    r->handler = DAV_HANDLER_NAME;
+    /* ### this is wrong.  We should only be setting the r->handler for the
+     * requests that mod_dav knows about.  If we set the handler for M_POST
+     * requests, then CGI scripts that use POST will return the source for the
+     * script.  However, mod_dav DOES handle POST, so something else needs 
+     * to be fixed.
+     */
+    if (r->method_number != M_POST) {
 
-    return OK;
+        /* We are going to be handling the response for this resource. */
+        r->handler = DAV_HANDLER_NAME;
+        return OK;
+    }
+
+    return DECLINED;
 }
 
 static void register_hooks(apr_pool_t *p)