From: Justin Erenkrantz Date: Tue, 13 Nov 2001 05:10:24 +0000 (+0000) Subject: Resolve the mod_dir overaggressive redirection problem seen with non-GET X-Git-Tag: 2.0.29~162 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5037776800459cef6f6c93917c90a3e89c488be;p=thirdparty%2Fapache%2Fhttpd.git Resolve the mod_dir overaggressive redirection problem seen with non-GET requests for WebFolders. Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91894 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 0aa8d9abf33..19424c208f3 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2001/11/13 05:04:24 $] +Last modified at [$Date: 2001/11/13 05:10:24 $] Release: @@ -63,14 +63,6 @@ RELEASE SHOWSTOPPERS: filename extensions. Add...FilterByType will add to this quandry. Some sort of resolution needs to be proposed, - * mod_dir should normally redirect ALL directory requests which do - not include a trailing slash on the URI. However, if a "notes" - flag is set (say, via BrowserMatch), this behavior will be - disabled for non-GET requests. - Status: Greg volunteers - MsgId: <20010227104646.E2297@lyra.org> - MsgId: <3A9C0097.9C83F07C@Golux.Com> - * mod_negotiation needs a new option or directive, something like ForceLanguagePriority, to fall back to the LanguagePriority directive instead of returning a "no acceptable variant" error. diff --git a/docs/conf/httpd-std.conf b/docs/conf/httpd-std.conf index 93d74498160..131ae2e0aa0 100644 --- a/docs/conf/httpd-std.conf +++ b/docs/conf/httpd-std.conf @@ -902,6 +902,14 @@ BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 +# +# The following directive disables redirects on non-GET requests for +# a directory that does not include the trailing slash. This fixes a +# problem with Microsoft WebFolders which does not appropriately handle +# redirects for folders with DAV methods. +# +#BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully + # # Allow server status reports, with the URL of http://servername/server-status # Change the ".your_domain.com" to match your domain to enable. diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 6097e0a8cba..0c867d1105c 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -118,9 +118,12 @@ static void *merge_dir_configs(apr_pool_t *p, void *basev, void *addv) static int fixup_dir(request_rec *r) { - /* only (potentially) redirect for GET requests against directories */ - if (r->method_number != M_GET || r->finfo.filetype != APR_DIR) { - return DECLINED; + /* only redirect for requests against directories or when we have + * a note that says that this browser can not handle redirs on + * non-GET requests (such as Microsoft's WebFolders). */ + if (r->finfo.filetype != APR_DIR || (r->method_number != M_GET && + apr_table_get(r->subprocess_env, "redirect-carefully"))) { + return DECLINED; } if (r->uri[0] == '\0' || r->uri[strlen(r->uri) - 1] != '/') {