Index: subversion/mod_dav_svn/mirror.c
===================================================================
--- subversion/mod_dav_svn/mirror.c	(revision 1931310)
+++ subversion/mod_dav_svn/mirror.c	(working copy)
@@ -60,6 +60,46 @@ static int proxy_request_fixup(request_rec *r,
                                                r->pool);
     r->handler = "proxy-server";
 
+    /* Rewrite the Destination header if present (for COPY/MOVE requests).
+    The Destination header contains a full URL pointing to the slave,
+    which needs to be rewritten to point to the master. */    
+    const char *destination = apr_table_get(r->headers_in, "Destination");
+    if (destination) {
+        const char *root_dir = dav_svn__get_root_dir(r);
+        apr_uri_t dest_uri;
+        apr_uri_t master_uri_parsed;
+
+        if (apr_uri_parse(r->pool, destination, &dest_uri) == APR_SUCCESS &&
+            apr_uri_parse(r->pool, master_uri, &master_uri_parsed) == APR_SUCCESS &&
+            dest_uri.path) {
+            const char *dest_path = svn_urlpath__canonicalize(dest_uri.path,
+                                                              r->pool);
+            /* Check if destination path starts with root_dir */
+            if (strncmp(dest_path, root_dir, strlen(root_dir)) == 0) {
+                const char *remainder = dest_path + strlen(root_dir);
+                const char *master_path = svn_urlpath__canonicalize(
+                                                master_uri_parsed.path,
+                                                r->pool);
+                const char *new_path = apr_pstrcat(r->pool,
+                                                    master_path,
+                                                    remainder,
+                                                    SVN_VA_NULL);
+                /* Reconstruct the destination URL with master's
+                    host and rewritten path */
+                dest_uri.hostname = master_uri_parsed.hostname;
+                dest_uri.scheme = master_uri_parsed.scheme;
+                dest_uri.port = master_uri_parsed.port;
+                dest_uri.port_str = master_uri_parsed.port_str;
+                dest_uri.path = (char *)svn_path_uri_encode(new_path,
+                                                            r->pool);
+
+                apr_table_set(r->headers_in, "Destination",
+                              apr_uri_unparse(r->pool, &dest_uri, 0));
+            }
+        }
+    }
+    
+
     /* ### FIXME: Seems we could avoid adding some or all of these
            filters altogether when the root_dir (that is, the slave's
            location, relative to the server root) and path portion of
