Always returns MULTISTATUS on WebDAV REPORT responses

This commit is contained in:
mdecimus 2025-06-28 06:44:41 +02:00
parent 861471fde4
commit c1a638c19e

View file

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