]> granicus.if.org Git - apache/commitdiff
* modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the
authorJoe Orton <jorton@apache.org>
Tue, 25 Nov 2003 14:17:55 +0000 (14:17 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 25 Nov 2003 14:17:55 +0000 (14:17 +0000)
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

index 2ad0e657863cc725f709f3d13d8c4432955e5898..69d87db175675f1b5ed24693d667095ba9736ae5 100644 (file)
@@ -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.");