Skip to content

Conversation

@hairmare
Copy link

The buggy behaviour when passing multiple props is that they get mapped
to the final XML string with a , separator.

⚠️ This is a bug-report-in-form-of-a-test rather than a direct contribution.

Example

I have been mucking about with the low-level API for no good reason and tried to use dav.request.calendarQuery (and by extension dav.template.caledarQuery?) with invalid results.

dav = require('dav')

xhr = new dav.transport.Transport(new dav.Credentials())
client = new dav.Client(xhr)
req = dav.request.calendarQuery({
  props: [
    { name: 'catdog', namespace: dav.ns.DAV },
    { name: 'winslow', namespace: dav.ns.CALDAV },
  ],
})
client.send(req, 'https://example.org/remote.php/dav/calendars/user/calname')

Observed Results

The sent XML is invalid due to a comma:

    <d:prop>
      <d:catdog />,<c:winslow />
    </d:prop>

Expected Results

The XML should not contain a comma between the props:

    <d:prop>
      <d:catdog /><c:winslow />
    </d:prop>

More Info

The endpoint in question is an ownCloud instance which is why I'm even trying to do it via low-level code 🙄.

I didn't figure out a proper fix but hope that the included test will help narrow down the issue for someone better versed in the code base.

The buggy behaviour when passing multiple props is that they get mapped
to the final XML string with a `,` separator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant