From b7231454c131bec56554f76e4e3c60aec9143705 Mon Sep 17 00:00:00 2001 From: stephan1827 Date: Thu, 25 Jun 2026 20:30:46 +0200 Subject: [PATCH] fix: use correct Content-Type for vCard PUT requests RFC 6350 defines the media type for vCard data as text/vcard, not application/vcard. Sending application/vcard causes CardDAV servers that strictly validate the Content-Type (e.g. Fastmail/Cyrus) to reject PUT requests with 403 Forbidden / , leaving contacts unsynced to the remote server. Change entityCreate() and entityModify() in RemoteContactsService to use text/vcard; charset=utf-8, consistent with how RemoteEventsService already uses text/calendar; charset=utf-8 for iCalendar data. Co-Authored-By: Claude Sonnet 4.6 --- lib/Service/Remote/RemoteContactsService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/Remote/RemoteContactsService.php b/lib/Service/Remote/RemoteContactsService.php index a48bea7..97bb141 100644 --- a/lib/Service/Remote/RemoteContactsService.php +++ b/lib/Service/Remote/RemoteContactsService.php @@ -277,7 +277,7 @@ public function entityCreate(Entity $so): ?Entity { } $data = $so->data; - $result = $this->dataStore->create($path, $data, 'application/vcard'); + $result = $this->dataStore->create($path, $data, 'text/vcard; charset=utf-8'); $ro = clone $so; // persist the full resource path so the stored identifier matches what a @@ -300,7 +300,7 @@ public function entityModify(Entity $so): ?Entity { } $data = $so->data; - $result = $this->dataStore->update($path, $data, 'application/vcard'); + $result = $this->dataStore->update($path, $data, 'text/vcard; charset=utf-8'); $ro = clone $so; $ro->remoteSignature = $result['etag'] ?? null;