mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
carddav: fix file suffix and content type
This commit is contained in:
@@ -46,7 +46,7 @@ pub async fn get_object<AS: AddressbookStore + ?Sized>(
|
|||||||
|
|
||||||
Ok(HttpResponse::Ok()
|
Ok(HttpResponse::Ok()
|
||||||
.insert_header(("ETag", object.get_etag()))
|
.insert_header(("ETag", object.get_etag()))
|
||||||
.insert_header(("Content-Type", "text/calendar"))
|
.insert_header(("Content-Type", "text/vcard"))
|
||||||
.body(object.get_vcf().to_owned()))
|
.body(object.get_vcf().to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ impl Resource for AddressObjectResource {
|
|||||||
AddressObjectProp::AddressData(self.0.get_vcf().to_owned())
|
AddressObjectProp::AddressData(self.0.get_vcf().to_owned())
|
||||||
}
|
}
|
||||||
AddressObjectPropName::Getcontenttype => {
|
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);
|
type Inner = (String, String, String);
|
||||||
let (principal, calendar, mut object) = Inner::deserialize(deserializer)?;
|
let (principal, calendar, mut object) = Inner::deserialize(deserializer)?;
|
||||||
if object.ends_with(".ics") {
|
if object.ends_with(".vcf") {
|
||||||
object.truncate(object.len() - 4);
|
object.truncate(object.len() - 4);
|
||||||
}
|
}
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user