Skip to content

Keep WebDAV URL escapes intact when fetching files and folders - #1052

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/webdav-request-paths
Oct 2, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/webdav-request-paths

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

A WebDAV href such as plan%23draft.txt or what%3Fnow.txt was decoded before GET, turning filename characters into a URL fragment or query. Literal percent escapes could fetch a different file, and the same problem in a collection name could abort recursive synchronization.

Keep escaped href paths for GET and recursive PROPFIND, separately from document identity. Ordinary existing identities retain their shape; proxy-rewritten absolute hrefs are parsed before their path segments are decoded and reserialized, so distinct #, ?, and literal % names cannot collapse to the same document key.

Validation:

  • Both local HTTP regressions failed before the fix (1 of 4 files fetched; encoded collection returned 404). A review regression also reproduced proxy-key collisions before they were fixed.
  • The local HTTP fixture checks exact request targets, nine distinct filenames across relative/same-host/proxy hrefs, stable ordinary identities, Unicode/spaces, and nested collection traversal/self-skip.
  • All 10 local WebDAV tests pass. The existing live-server test requires UTOPIA_DAV_TEST_URL and was not exercised.
  • Workspace formatting, clippy with -D warnings, tests with PostgreSQL 16/pgvector and required DB/PDF guards, and build pass using Rust 1.98.1.
  • The unchanged web baseline passes its 223 tests and production build, including typecheck and style guard.

Signed-off-by: dada-yan <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Maya-Kid. Keeping two paths, the escaped one for the request and the decoded one for the document's identity, is the right split: %23 and %3F stay filename bytes on the wire, and ordinary files keep the keys they already have. The proxy branch decoding after parsing and re-encoding per segment is what keeps #, ? and a literal % distinct there. The 11 WebDAV tests pass here. Landing it.

@WaylandYang
WaylandYang merged commit 45071b4 into deeplethe:dev Oct 2, 2026
6 checks passed
@WaylandYang WaylandYang mentioned this pull request Oct 2, 2026
@Maya-Kid
Maya-Kid deleted the codex/webdav-request-paths branch October 15, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants