Allow infinity Depth searches under /dav/pal

This commit is contained in:
mdecimus
2025-06-07 22:25:16 +02:00
parent 4ac60feca2
commit fe074ad369

View File

@@ -129,19 +129,21 @@ impl PropFindRequestHandler for Server {
let return_children = match headers.depth { let return_children = match headers.depth {
Depth::One | Depth::None => true, Depth::One | Depth::None => true,
Depth::Zero => false, Depth::Zero => false,
Depth::Infinity => { Depth::Infinity => match resource.collection {
if resource.account_id.is_none() Collection::Principal => true,
|| resource.resource.is_none() Collection::Calendar | Collection::AddressBook
|| matches!(resource.collection, Collection::FileNode) if resource.account_id.is_some() && resource.resource.is_some() =>
{ {
true
}
_ => {
return Err(DavErrorCondition::new( return Err(DavErrorCondition::new(
StatusCode::FORBIDDEN, StatusCode::FORBIDDEN,
BaseCondition::PropFindFiniteDepth, BaseCondition::PropFindFiniteDepth,
) )
.into()); .into());
} }
true },
}
}; };
// List shared resources // List shared resources