From: Ryan Bloom Date: Mon, 30 Sep 2002 05:10:07 +0000 (+0000) Subject: Allow CGI scripts that use POST and mod_dav to exist in the same location. X-Git-Tag: WROWE_2_0_43_PRE1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43a63ebc6a9b88a4224079969c216deef2025a6f;p=apache Allow CGI scripts that use POST and mod_dav to exist in the same location. 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 --- diff --git a/CHANGES b/CHANGES index d4afb23b78..1ce2ddc760 100644 --- 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 ] diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 24f63e351f..707fed3760 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -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)