Author: jpeck
Date: Wed Jul  8 22:39:36 2026
New Revision: 1936015

Log:
Follow-up to r1936010: attach the rewrite filter by whitelist, not blacklist.
Continued fix for issue #3445

HTTPv2 clients send the log message and revision properties inside the
create-txn-with-props POST body, a length-prefixed skel carrying only
user data.  The rewrite corrupted revprop values that mention the slave
URL, and broke the skel framing outright (failing the commit) whenever
the master and slave location paths differ in length.

Invert the condition: only MERGE and CHECKOUT (v1) request bodies carry
protocol hrefs the master must resolve, so attach the filter only to 
those. A method missing from the whitelist now fails loudly at the master
(untranslated href) instead of silently corrupting user data.

Regression tests follow in the dav-mirror-autocheck.sh commit.

* subversion/mod_dav_svn/mirror.c
  (proxy_request_fixup): Attach the IncomingRewrite input filter only
   for MERGE and CHECKOUT requests, replacing the exclusion list.

Modified:
   subversion/branches/proxy-move-copy-fix/subversion/mod_dav_svn/mirror.c

Modified: 
subversion/branches/proxy-move-copy-fix/subversion/mod_dav_svn/mirror.c
==============================================================================
--- subversion/branches/proxy-move-copy-fix/subversion/mod_dav_svn/mirror.c     
Wed Jul  8 21:47:26 2026        (r1936014)
+++ subversion/branches/proxy-move-copy-fix/subversion/mod_dav_svn/mirror.c     
Wed Jul  8 22:39:36 2026        (r1936015)
@@ -121,12 +121,15 @@ static int proxy_request_fixup(request_r
     ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
     ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
 
-    /* PUT bodies are svndiff-encoded file content and PROPPATCH bodies carry
-       opaque property values & versioned payload, never protocol URLs.
-       Rewriting them corrupts data (issue #3445).  The hrefs we must
-       translate live in MERGE/CHECKOUT/REPORT bodies, which still get the
-       input filter. */
-    if (r->method_number != M_PUT && r->method_number != M_PROPPATCH)
+    /* Only MERGE and CHECKOUT (v1) request bodies carry protocol hrefs the
+       master must resolve (the activity/txn source href).  Every other body
+       reaching here is user or versioned payload -- svndiff file content in
+       PUT, property values in PROPPATCH, revprop skels in POST, the lock
+       owner in LOCK -- which the rewrite corrupts (issue #3445).  Attach
+       the filter only to what provably needs translation: a method missing
+       from this whitelist fails loudly at the master (untranslated href)
+       instead of silently corrupting data. */
+    if (r->method_number == M_MERGE || r->method_number == M_CHECKOUT)
         ap_add_input_filter("IncomingRewrite", NULL, r, r->connection);
 
     return OK;

Reply via email to