Fix CalDAV: calendar-query REPORT returns invalid HTTP 404 when no events match the query

This commit is contained in:
Maurus Decimus
2026-07-05 11:39:30 +02:00
parent 74ac0a7f0d
commit 9908baf2eb
2 changed files with 2 additions and 4 deletions

View File

@@ -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))
}