Give MKCOL the status vocabulary RFC 4918 defines - #983
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebDavWagon.mkdirsrecognised only201and405, and read everything else as "the ancestor is missing". Two consequences, both from the third bullet of #630: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.201was accepted, so a collection that appeared underneath us — a concurrent deploy, or an intermediate that already existed — failed the upload with405.RFC 4918 section 9.3.1 gives MKCOL a small vocabulary:
201is a collection we created,405one that was already there, and409says an ancestor is missing. Only409is 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, anddoMkColwent 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 newWebDavWagonMkColTestscripts 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:checkpasses.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.