Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPORT addressbook-multiget reports vCard Content-Type while returning jCard #29693

Closed
rfc2822 opened this issue Nov 13, 2021 · 3 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: caldav Related to CalDAV internals

Comments

@rfc2822
Copy link
Contributor

rfc2822 commented Nov 13, 2021

Hi,

We have implemented jCard support in DAVx⁵. Basically it works good with Nextcloud, but there is a problem:

  1. Request jCards from Nextcloud with REPORT <CARD:addressbook-multiget>…<CARD:address-data content-type="application/vcard+json" version="4.0" />
  2. Nextcloud actually returns the jCards, but with text/vcard in GetContentType:
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/addressbooks/users/test/931ba8fd-f3eb-4a9d-bed4-3109b9c64616/98493a6a-0c9e-4823-a7df-2ad139e69be9.vcf</d:href><d:propstat><d:prop><d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype><d:getetag>&quot;e49f0c3923faf5c21d2e6da8b1c0ed15&quot;</d:getetag><card:address-data>[&quot;vcard&quot;,[[&quot;version&quot;,{},&quot;text&quot;,&quot;4.0&quot;],[&quot;prodid&quot;,{},&quot;text&quot;,&quot;+\/\/IDN bitfire.at\/\/DAVx5\/4.0 ez-vcard\/0.11.3&quot;],[&quot;uid&quot;,…

(note the <d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype>)

So DAVx⁵ tries to interpret the content as vCard, which fails, so contact synchronization fails.

Expected result:
Nextcloud should return <d:getcontenttype>application/vcard+json; version=4.0</d:getcontenttype>


Nextcloud 22.2.2

@rfc2822 rfc2822 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 13, 2021
rfc2822 added a commit to bitfireAT/davx5-ose that referenced this issue Nov 13, 2021
@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@ArnyminerZ
Copy link

Can reproduce on 25.0.3. With this data file:

<!-- data.xml -->
<?xml version="1.0" encoding="utf-8" ?>
<C:addressbook-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
  <D:prop>
    <D:getetag/>
    <C:address-data content-type="application/vcard+json" version="4.0" />
  </D:prop>
  <D:href>/remote.php/dav/addressbooks/users/test/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000.vcf</D:href>
</C:addressbook-multiget>

And with curl:

$ curl -in -H "Authorization: Basic xxx" \
  -H "Depth: 1" \
  -X REPORT \
  -d @data.xml \
  https://cloud.bitfire.at/remote.php/dav/addressbooks/users/test/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000.vcf

Gives this response:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/addressbooks/users/test/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000.vcf</d:href>
    <d:propstat>
      <d:prop>
        <card:address-data>["vcard",[["version",{},"text","4.0"],["prodid",{},"text","+\/\/IDN bitfire.at\/\/DAVx5\/4.2.0-beta.1 ez-vcard\/0.11.3"],["uid",{},"text","00000000-0000-0000-0000-000000000000"],["fn",{},"text","xxx"],["n",{},"text",["xxx","xxx","xxx","",""]],["tel",{"type":"cell"},"text","(xxx) xxx-xx"],["photo",{},"uri","data:image\/jpeg;base64,..."],["rev",{},"timestamp","2022-03-11T21:35:57Z"]]]</card:address-data>
        <d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Clearly the response is correct, but the type returned, as stated by @rfc2822 is text/vcard

@joshtrichards joshtrichards added the feature: caldav Related to CalDAV internals label Aug 28, 2023
@SebastianKrupinski
Copy link
Contributor

Tested on version 30. "text/vcard" content type is no longer returned for a JSON request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

No branches or pull requests

5 participants