unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* url-dav and Radicale
@ 2016-05-01  9:10 Eric Abrahamsen
  2016-05-01 10:23 ` Yuri Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2016-05-01  9:10 UTC (permalink / raw)
  To: emacs-devel

Hi,

I'm having some trouble with Emacs' webdav implementation when trying to
talk to a Radicale[1] card/caldav server. I'm not the only one: I bumped
into this issue when using the org-caldav package, and found that
someone else had opened a github issue about this[2] (I'm the only other
poster there).

In a nutshell, Emacs' url-dav.el library, when parsing responses from a
DAV server, assumes XML node names that are all prefixed with "DAV:".
Ie, "DAV:multistatus". Radicale, on the other hand, just sends back
"multistatus", and everything blows up. The "DAV:" prefix is very much
hard-coded into url-dav.el.

It's pretty darn difficult to figure out what's supposed to happen here,
but the RFC (inasmuch as RFCs are human-parseable) appears to want the
DAV: prefix[3]. On the other hand, all other DAV-compatible software
appears to work just fine with Radicale.

Both Radicale and Emacs have working bug trackers, but only Emacs seems
to have a functioning mailing list, so I'm posting here first! If anyone
has any insight into this issue, please let me know. Otherwise I'll open
a github issue on Radicale.

Thanks,
Eric


[1]: http://radicale.org/
[2]: https://github.com/dengste/org-caldav/issues/86
[3]: https://www.ietf.org/rfc/rfc5323.txt




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: url-dav and Radicale
  2016-05-01  9:10 url-dav and Radicale Eric Abrahamsen
@ 2016-05-01 10:23 ` Yuri Khan
  2016-05-01 10:34   ` Eric Abrahamsen
  2016-05-04  0:05   ` Eric Abrahamsen
  0 siblings, 2 replies; 6+ messages in thread
From: Yuri Khan @ 2016-05-01 10:23 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Emacs developers

On Sun, May 1, 2016 at 3:10 PM, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> In a nutshell, Emacs' url-dav.el library, when parsing responses from a
> DAV server, assumes XML node names that are all prefixed with "DAV:".
> Ie, "DAV:multistatus".

As far as I can see, url-dav-process-response calls xml-parse-region
with the last argument set to 'symbol-qnames, which does the right
thing for non-default XML namespace prefixes whose URI is "DAV:".
Here:

<foo:multistatus xmlns:foo="DAV:">
</foo:multistatus>

M-: (xml-parse-region nil nil nil nil 'symbol-qnames)

⇒ ((DAV:multistatus ((... . "DAV:")) "
"))

However it does not handle the default namespace for me:

<multistatus xmlns="DAV:">
</multistatus>

M-: (xml-parse-region nil nil nil nil 'symbol-qnames)

⇒ ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:")) "
"))

That’s a bug in xml.el.


> Radicale, on the other hand, just sends back "multistatus"

Does it also send an xmlns="DAV:" on that element?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: url-dav and Radicale
  2016-05-01 10:23 ` Yuri Khan
@ 2016-05-01 10:34   ` Eric Abrahamsen
  2016-05-04  0:05   ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2016-05-01 10:34 UTC (permalink / raw)
  To: emacs-devel

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Sun, May 1, 2016 at 3:10 PM, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> In a nutshell, Emacs' url-dav.el library, when parsing responses from a
>> DAV server, assumes XML node names that are all prefixed with "DAV:".
>> Ie, "DAV:multistatus".
>
> As far as I can see, url-dav-process-response calls xml-parse-region
> with the last argument set to 'symbol-qnames, which does the right
> thing for non-default XML namespace prefixes whose URI is "DAV:".
> Here:
>
> <foo:multistatus xmlns:foo="DAV:">
> </foo:multistatus>
>
> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>
> ⇒ ((DAV:multistatus ((... . "DAV:")) "
> "))
>
> However it does not handle the default namespace for me:
>
> <multistatus xmlns="DAV:">
> </multistatus>
>
> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>
> ⇒ ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:")) "
> "))
>
> That’s a bug in xml.el.

Glad to hear from someone who understands XML!

>> Radicale, on the other hand, just sends back "multistatus"
>
> Does it also send an xmlns="DAV:" on that element?

Yes it does. Here's a full multistatus response from Radicale, with the
multis elided.

HTTP/1.1 207 Unknown
Date: Sun, 01 May 2016 10:28:45 GMT
Server: Apache/2.4.7 (Ubuntu)
DAV: 1, 2, 3, calendar-access, addressbook, extended-mkcol
Content-Length: 5804
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: text/xml
<?xml version="1.0"?><multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<response>
<href>/eric/eric/</href>
<propstat>
<prop>
<resourcetype>
<C:calendar />
<collection />
</resourcetype>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<response>
<href>/eric/eric/64d13baa-561e-4255-8fd8-78f3424ea1d8.ics</href>
<propstat>
<prop>
<resourcetype />
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
... More of same
</multistatus>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: url-dav and Radicale
  2016-05-01 10:23 ` Yuri Khan
  2016-05-01 10:34   ` Eric Abrahamsen
@ 2016-05-04  0:05   ` Eric Abrahamsen
  2016-05-04  0:14     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2016-05-04  0:05 UTC (permalink / raw)
  To: emacs-devel

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Sun, May 1, 2016 at 3:10 PM, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> In a nutshell, Emacs' url-dav.el library, when parsing responses from a
>> DAV server, assumes XML node names that are all prefixed with "DAV:".
>> Ie, "DAV:multistatus".
>
> As far as I can see, url-dav-process-response calls xml-parse-region
> with the last argument set to 'symbol-qnames, which does the right
> thing for non-default XML namespace prefixes whose URI is "DAV:".
> Here:
>
> <foo:multistatus xmlns:foo="DAV:">
> </foo:multistatus>
>
> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>
> ⇒ ((DAV:multistatus ((... . "DAV:")) "
> "))
>
> However it does not handle the default namespace for me:
>
> <multistatus xmlns="DAV:">
> </multistatus>
>
> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>
> ⇒ ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:")) "
> "))
>
> That’s a bug in xml.el.

The above should be enough for me to open a bug report, right?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: url-dav and Radicale
  2016-05-04  0:05   ` Eric Abrahamsen
@ 2016-05-04  0:14     ` Lars Ingebrigtsen
  2016-05-04  0:36       ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-05-04  0:14 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-devel

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Yuri Khan <yuri.v.khan@gmail.com> writes:
>
>> On Sun, May 1, 2016 at 3:10 PM, Eric Abrahamsen
>> <eric@ericabrahamsen.net> wrote:
>>
>>> In a nutshell, Emacs' url-dav.el library, when parsing responses from a
>>> DAV server, assumes XML node names that are all prefixed with "DAV:".
>>> Ie, "DAV:multistatus".
>>
>> As far as I can see, url-dav-process-response calls xml-parse-region
>> with the last argument set to 'symbol-qnames, which does the right
>> thing for non-default XML namespace prefixes whose URI is "DAV:".
>> Here:
>>
>> <foo:multistatus xmlns:foo="DAV:">
>> </foo:multistatus>
>>
>> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>>
>> ⇒ ((DAV:multistatus ((... . "DAV:")) "
>> "))
>>
>> However it does not handle the default namespace for me:
>>
>> <multistatus xmlns="DAV:">
>> </multistatus>
>>
>> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>>
>> ⇒ ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:")) "
>> "))
>>
>> That’s a bug in xml.el.
>
> The above should be enough for me to open a bug report, right?

Yup.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: url-dav and Radicale
  2016-05-04  0:14     ` Lars Ingebrigtsen
@ 2016-05-04  0:36       ` Eric Abrahamsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2016-05-04  0:36 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Yuri Khan <yuri.v.khan@gmail.com> writes:
>>

[...]

>>> However it does not handle the default namespace for me:
>>>
>>> <multistatus xmlns="DAV:">
>>> </multistatus>
>>>
>>> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>>>
>>> ⇒ ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:")) "
>>> "))
>>>
>>> That’s a bug in xml.el.
>>
>> The above should be enough for me to open a bug report, right?
>
> Yup.

Done: 23440




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-04  0:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-01  9:10 url-dav and Radicale Eric Abrahamsen
2016-05-01 10:23 ` Yuri Khan
2016-05-01 10:34   ` Eric Abrahamsen
2016-05-04  0:05   ` Eric Abrahamsen
2016-05-04  0:14     ` Lars Ingebrigtsen
2016-05-04  0:36       ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).