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 {
Depth::One | Depth::None => true,
Depth::Zero => false,
Depth::Infinity => {
if resource.account_id.is_none()
|| resource.resource.is_none()
|| matches!(resource.collection, Collection::FileNode)
Depth::Infinity => match resource.collection {
Collection::Principal => true,
Collection::Calendar | Collection::AddressBook
if resource.account_id.is_some() && resource.resource.is_some() =>
{
true
}
_ => {
return Err(DavErrorCondition::new(
StatusCode::FORBIDDEN,
BaseCondition::PropFindFiniteDepth,
)
.into());
}
true
}
},
};
// List shared resources