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 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>]
}
}
- /* 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)