Skip to content

Give MKCOL the status vocabulary RFC 4918 defines - #983

Merged
slachiewicz merged 1 commit into
wagon-3.xfrom
agent/webdav-mkcol-status
Sep 4, 2026
Merged

Give MKCOL the status vocabulary RFC 4918 defines#983
slachiewicz merged 1 commit into
wagon-3.xfrom
agent/webdav-mkcol-status

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

WebDavWagon.mkdirs recognised only 201 and 405, and read everything else as "the ancestor is missing". Two consequences, both from the third bullet of #630:

  • A 403, or an authentication failure, sent the walk further back instead of being reported. It kept stepping up to the root and then failed on the way down, naming a path that was never the problem.
  • On the way down only 201 was accepted, so a collection that appeared underneath us — a concurrent deploy, or an intermediate that already existed — failed the upload with 405.

RFC 4918 section 9.3.1 gives MKCOL a small vocabulary: 201 is a collection we created, 405 one that was already there, and 409 says an ancestor is missing. Only 409 is a reason to step back; only the first two mean carry on. Anything else is now reported where it happens.

The traversal moved into a package-private mkColPath(baseUrl, relpath) so the status handling can be driven without a server, and doMkCol went from private to package-private as the seam. No public API changes.

Verified: mvn install -pl wagon-providers/wagon-webdav-jackrabbit -am → 308 tests, 0 failures, including all four 71-test server-backed suites unchanged. The new WebDavWagonMkColTest scripts the statuses a real server will not produce on demand. Negative control: reverting the production change turns 3 of its 5 cases red — one per defect above, plus the exhausted-path case — while the two describing preserved behaviour stay green. spotless:check passes.

This does not close #630 on its own: the remaining bullet there is that the WebDAV tests still run through the HTTP test base.

This change was created with AI assistance.

Only 409 means an ancestor is missing, so only 409 should send the walk
further back; treating every other answer that way turned a 403 or an
authentication failure into a confusing error about the top of the path.
On the way down, 405 means the collection is already there, which is as
good as having created it -- rejecting it failed uploads whenever a
collection appeared underneath us. Do not narrow either set back to
201-only; the walk is not atomic and the server is entitled to both.
@slachiewicz slachiewicz added the bug Something isn't working label Sep 4, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 4, 2026 10:06
@slachiewicz
slachiewicz merged commit f0b0877 into wagon-3.x Sep 4, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the agent/webdav-mkcol-status branch September 4, 2026 11:33
@github-actions github-actions Bot added this to the 3.5.4 milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant