fix: preserve WebDAV password display and validate MKCOL 405 (#1685)

* fix: preserve WebDAV password display and validate MKCOL 405

* fix: scope WebDAV password preservation to post-save refresh
This commit is contained in:
Alexlangl
2026-03-30 22:13:21 +08:00
committed by GitHub
parent 67e074c0a7
commit 4f7ea76347
3 changed files with 171 additions and 15 deletions
+4 -3
View File
@@ -204,10 +204,11 @@ pub async fn ensure_remote_directories(
s if s == StatusCode::CREATED || s.is_success() => {
log::info!("[WebDAV] MKCOL ok: {}", redact_url(&dir_url));
}
// 405 commonly means "already exists" on many WebDAV servers
StatusCode::METHOD_NOT_ALLOWED => {}
// Ambiguous — verify directory actually exists via PROPFIND
s if s == StatusCode::CONFLICT || s.is_redirection() => {
s if s == StatusCode::METHOD_NOT_ALLOWED
|| s == StatusCode::CONFLICT
|| s.is_redirection() =>
{
if !propfind_exists(&client, &dir_url, auth).await? {
return Err(webdav_status_error("MKCOL", status, &dir_url));
}