From c1a638c19ee84e3dcaf172789c98560392d4010f Mon Sep 17 00:00:00 2001 From: mdecimus Date: Sat, 28 Jun 2025 06:44:41 +0200 Subject: [PATCH] Always returns MULTISTATUS on WebDAV REPORT responses --- crates/dav/src/common/propfind.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/dav/src/common/propfind.rs b/crates/dav/src/common/propfind.rs index ed8ecc71..1780abb5 100644 --- a/crates/dav/src/common/propfind.rs +++ b/crates/dav/src/common/propfind.rs @@ -319,12 +319,14 @@ impl PropFindRequestHandler for Server { self.core.groupware.max_results, ); let mut is_sync_limited = false; + let mut is_propfind = false; let paths = match std::mem::take(&mut query.resource) { DavQueryResource::Uri(resource) => { collection_container = resource.collection; collection_children = collection_container.child_collection().unwrap(); sync_collection = SyncCollection::from(collection_container); + is_propfind = true; get( self, @@ -1124,6 +1126,12 @@ impl PropFindRequestHandler for Server { if !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 { + response.add_response( + Response::new_status([query.uri], StatusCode::NOT_FOUND) + .with_response_description("No resources found"), + ); + Ok(HttpResponse::new(StatusCode::MULTI_STATUS).with_xml_body(response.to_string())) } else { Ok(HttpResponse::new(StatusCode::NOT_FOUND)) }