mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-11-10 20:50:50 +08:00
* fix(webdav): retry collection stat with trailing slash Some WebDAV servers (e.g. InfiniCloud) answer a PROPFIND on a collection path without the trailing slash with a redirect the HTTP client follows into a plain 200 HTML response instead of the required 207 Multi-Status, so every stat of a subdirectory fails even though the directory exists. The upstream symptom this produces: any upload into a nested directory dies with "failed to get dir [<path>]: failed to get obj: PROPFIND <path>: 200" — MakeDir succeeds, then the stat of the freshly created parent dir fails, because op.GetUnwrap goes straight to driver.Get. Retry the stat once against the canonical collection URL (slash appended) before giving up; 404s are not retried, and paths already carrying the slash skip the retry. The new test reproduces the quirky server (slash-less PROPFIND -> 200 HTML, slash PROPFIND -> 207) and fails on the unpatched driver with the exact production error. Co-Authored-By: Claude Code <noreply@anthropic.com> * Update drivers/webdav/driver.go Signed-off-by: Yinan Qin <elysia-best@simplelinux.cn.eu.org> * Update drivers/webdav/driver_test.go Signed-off-by: Yinan Qin <elysia-best@simplelinux.cn.eu.org> --------- Signed-off-by: Yinan Qin <elysia-best@simplelinux.cn.eu.org> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Yinan Qin <elysia-best@simplelinux.cn.eu.org> Co-authored-by: Pikachu Ren <40362270+PIKACHUIM@users.noreply.github.com>