carddav: fix file suffix and content type

This commit is contained in:
Lennart
2024-10-27 15:26:34 +01:00
parent 86feb4e189
commit df8790f46d
2 changed files with 3 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ pub async fn get_object<AS: AddressbookStore + ?Sized>(
Ok(HttpResponse::Ok()
.insert_header(("ETag", object.get_etag()))
.insert_header(("Content-Type", "text/calendar"))
.insert_header(("Content-Type", "text/vcard"))
.body(object.get_vcf().to_owned()))
}

View File

@@ -66,7 +66,7 @@ impl Resource for AddressObjectResource {
AddressObjectProp::AddressData(self.0.get_vcf().to_owned())
}
AddressObjectPropName::Getcontenttype => {
AddressObjectProp::Getcontenttype("text/calendar;charset=utf-8".to_owned())
AddressObjectProp::Getcontenttype("text/vcard;charset=utf-8".to_owned())
}
})
}
@@ -91,7 +91,7 @@ impl<'de> Deserialize<'de> for AddressObjectPathComponents {
{
type Inner = (String, String, String);
let (principal, calendar, mut object) = Inner::deserialize(deserializer)?;
if object.ends_with(".ics") {
if object.ends_with(".vcf") {
object.truncate(object.len() - 4);
}
Ok(Self {