From 9908baf2ebf4c69d5de0aefa025dd215bb1e81f9 Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Sun, 5 Jul 2026 11:39:30 +0200 Subject: [PATCH] Fix CalDAV: `calendar-query` REPORT returns invalid HTTP `404` when no events match the query --- CHANGELOG.md | 1 + crates/dav/src/common/propfind.rs | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6482e84b..93797caf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If - IDN: `sanitize_email` rejects valid Punycode domains. - Auto-ban: IP block expiration ignores per-reason ban durations. - Meilisearch: Limit the text search scope using `attributesToSearchOn`. +- CalDAV: `calendar-query` REPORT returns invalid HTTP `404` when no events match the query. ## [0.16.11] - 2026-06-25 diff --git a/crates/dav/src/common/propfind.rs b/crates/dav/src/common/propfind.rs index dff11f37..55256514 100644 --- a/crates/dav/src/common/propfind.rs +++ b/crates/dav/src/common/propfind.rs @@ -1123,11 +1123,8 @@ impl PropFindRequestHandler for Server { ); } - if !response.response.0.is_empty() || !query.sync_type.is_none() { + if !is_propfind || !response.response.0.is_empty() || !query.sync_type.is_none() { Ok(HttpResponse::new(StatusCode::MULTI_STATUS).with_xml_body(response.to_string())) - } else if !is_propfind { - Ok(HttpResponse::new(StatusCode::MULTI_STATUS) - .with_xml_body(MultiStatus::not_found(query.uri).to_string())) } else { Ok(HttpResponse::new(StatusCode::NOT_FOUND)) }