Fix bug with missing trailing slash in propfind response

This commit is contained in:
Lennart
2025-06-09 22:36:11 +02:00
parent 6d6f8f20df
commit 7628cdafbd
22 changed files with 32 additions and 22 deletions

View File

@@ -76,13 +76,8 @@ 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('/'), name),
member_responses.push(member.propfind(
&format!("{}/{}", path.trim_end_matches('/'), member.get_name()),
&propfind_member.prop,
puri,
principal,
@@ -90,7 +85,7 @@ pub(crate) async fn route_propfind<R: ResourceService>(
}
}
let response = resource.propfind_typed(path, &propfind_self.prop, puri, principal)?;
let response = resource.propfind(path, &propfind_self.prop, puri, principal)?;
Ok(MultistatusElement {
responses: vec![response],