Make sure collections have trailing slashes (py-caldav is very pedantic about that)

This commit is contained in:
Lennart
2025-06-09 22:23:01 +02:00
parent fc590976bc
commit 6d6f8f20df
13 changed files with 18 additions and 4 deletions

View File

@@ -76,8 +76,13 @@ pub(crate) async fn route_propfind<R: ResourceService>(
let mut member_responses = Vec::new();
if depth != &Depth::Zero {
for member in resource_service.get_members(path_components).await? {
// Collections should have a trailing slash
let mut name = member.get_name();
if R::IS_COLLECTION {
name.push('/')
}
member_responses.push(member.propfind_typed(
&format!("{}/{}", path.trim_end_matches('/'), member.get_name()),
&format!("{}/{}", path.trim_end_matches('/'), name),
&propfind_member.prop,
puri,
principal,

View File

@@ -18,6 +18,7 @@ pub trait ResourceService: Clone + Sized + Send + Sync + AxumMethods + 'static {
type PrincipalUri: PrincipalUri;
const DAV_HEADER: &'static str;
const IS_COLLECTION: bool;
async fn get_members(
&self,