From: Joe Orton Date: Tue, 25 Nov 2003 14:17:55 +0000 (+0000) Subject: * modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the X-Git-Tag: pre_ajp_proxy~1003 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fa53b990504e52fa2dc479b0d302f66afb93454;p=apache * modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the destination resource, propagate the WWW-Auth header from the subrequest back to the client. PR: 15571 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101885 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 2ad0e65786..69d87db175 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -2635,6 +2635,15 @@ static int dav_method_copymove(request_rec *r, int is_move) return dav_error_response(r, lookup.err.status, lookup.err.desc); } if (lookup.rnew->status != HTTP_OK) { + const char *auth = apr_table_get(lookup.rnew->err_headers_out, + "WWW-Authenticate"); + if (lookup.rnew->status == HTTP_UNAUTHORIZED && auth != NULL) { + /* propagate the WWW-Authorization header up from the + * subreq so the client sees it. */ + apr_table_set(r->err_headers_out, "WWW-Authenticate", + apr_pstrdup(r->pool, auth)); + } + /* ### how best to report this... */ return dav_error_response(r, lookup.rnew->status, "Destination URI had an error.");