WebDAV: MOVE rejects the current If-Match ETag #1306

Open
opened 2026-10-07 03:31:36 +00:00 by kayg · 1 comment
Owner

Steps:

  1. Create a WebDAV file with PUT and If-None-Match: *.
  2. Read its ETag with GET.
  3. Update it with PUT and the current If-Match value; this returns 204 and a new ETag.
  4. Send MOVE with Destination, Overwrite: F, and that new current If-Match value.

Expected: MOVE returns 201 and the file appears at the destination. The ETag matches the current source representation.

Actual: MOVE returns 412 for the current ETag. The same ETag succeeds for conditional PUT, and a stale ETag correctly returns 412.

Evidence: artifacts/bash-interop/webdav-move-if-match.txt

Severity: major

Steps: 1. Create a WebDAV file with `PUT` and `If-None-Match: *`. 2. Read its ETag with `GET`. 3. Update it with `PUT` and the current `If-Match` value; this returns 204 and a new ETag. 4. Send `MOVE` with `Destination`, `Overwrite: F`, and that new current `If-Match` value. Expected: MOVE returns 201 and the file appears at the destination. The ETag matches the current source representation. Actual: MOVE returns 412 for the current ETag. The same ETag succeeds for conditional PUT, and a stale ETag correctly returns 412. Evidence: `artifacts/bash-interop/webdav-move-if-match.txt` Severity: major
Author
Owner

Fixed in 50495909d (Fix WebDAV MOVE If-Match handling). The Files Index stores the source digest without HTTP quotes; MOVE now compares the quoted DAV entity-tag representation, so a current If-Match succeeds while a stale validator still fails.

Live curl against the local production server returned 201 for MOVE with the current quoted ETag; the old URI then returned 404 and the destination returned the expected file. The focused regression verifies that a stale ETag returns 412. Before/after evidence: artifacts/bash-interop/webdav-move-if-match.txt and artifacts/bash-interop/webdav-move-if-match-fixed.txt.

Fixed in `50495909d` (`Fix WebDAV MOVE If-Match handling`). The Files Index stores the source digest without HTTP quotes; MOVE now compares the quoted DAV entity-tag representation, so a current If-Match succeeds while a stale validator still fails. Live curl against the local production server returned 201 for MOVE with the current quoted ETag; the old URI then returned 404 and the destination returned the expected file. The focused regression verifies that a stale ETag returns 412. Before/after evidence: `artifacts/bash-interop/webdav-move-if-match.txt` and `artifacts/bash-interop/webdav-move-if-match-fixed.txt`.
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal-v0#1306
No description provided.