From 7fa53b990504e52fa2dc479b0d302f66afb93454 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 Nov 2003 14:17:55 +0000 Subject: [PATCH] * 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 --- modules/dav/main/mod_dav.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 2ad0e657863..69d87db1756 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."); -- 2.47.3