fix(integrations/dav-server): improve WebDAV handling#7882
Open
ngg wants to merge 1 commit into
Open
Conversation
Normalize DavPath values before using them for comparisons against OpenDAL paths. OpenDAL normalizes operation paths internally, so the DAV integration compares paths in that same form when checking lister output and collection moves. Use directory-shaped paths for collection metadata, listing, creation, and deletion. Slashless collection requests now fall back to trailing slash paths. Support moving empty collections by creating the destination collection and deleting the source after a limited listing confirms the source is empty. This is needed so Windows Explorer can create a folder by renaming the initial New folder collection. Directory copies and non-empty directory moves still return NotImplemented. Gate DAV append requests on write_can_append. Honor create_new by using if-not-exists only when write_with_if_not_exists is advertised. Map more OpenDAL errors to WebDAV errors, including Unsupported, path-type errors, and conditional conflicts. Fixes apache#7881
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.
Which issue does this PR close?
Fixes #7881.
Rationale for this change
What changes are included in this PR?
Normalize DavPath values before using them for comparisons against OpenDAL paths. OpenDAL normalizes operation paths internally, so the DAV integration compares paths in that same form when checking lister output and collection moves.
Use directory-shaped paths for collection metadata, listing, creation, and deletion. Slashless collection requests now fall back to trailing slash paths.
Support moving empty collections by creating the destination collection and deleting the source after a limited listing confirms the source is empty. This is needed so Windows Explorer can create a folder by renaming the initial New folder collection. Directory copies and non-empty directory moves still return NotImplemented.
Gate DAV append requests on write_can_append. Honor create_new by using if-not-exists only when write_with_if_not_exists is advertised. Map more OpenDAL errors to WebDAV errors, including Unsupported, path-type errors, and conditional conflicts.
Are there any user-facing changes?
WebDAV integration works better.
AI Usage Statement
I used Codex with GPT-5.5 to help draft and refine the change. I manually reviewed the generated code and tested the resulting behavior from Windows Explorer against a WebDAV path backed by OpenDAL.