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

@@ -41,6 +41,7 @@ impl<AS: AddressbookStore> ResourceService for AddressObjectResourceService<AS>
type PrincipalUri = CardDavPrincipalUri;
const DAV_HEADER: &str = "1, 3, access-control, addressbook";
const IS_COLLECTION: bool = false;
async fn get_resource(
&self,

View File

@@ -52,6 +52,7 @@ impl<AS: AddressbookStore, S: SubscriptionStore> ResourceService
type PrincipalUri = CardDavPrincipalUri;
const DAV_HEADER: &str = "1, 3, access-control, addressbook";
const IS_COLLECTION: bool = true;
async fn get_resource(
&self,

View File

@@ -23,7 +23,7 @@ pub struct CardDavPrincipalUri(&'static str);
impl PrincipalUri for CardDavPrincipalUri {
fn principal_uri(&self, principal: &str) -> String {
format!("{}/principal/{}", self.0, principal)
format!("{}/principal/{}/", self.0, principal)
}
}

View File

@@ -55,6 +55,7 @@ impl<A: AddressbookStore, AP: AuthenticationProvider, S: SubscriptionStore> Reso
type PrincipalUri = CardDavPrincipalUri;
const DAV_HEADER: &str = "1, 3, access-control, addressbook";
const IS_COLLECTION: bool = true;
async fn get_resource(
&self,