cern-fts / davix

High-performance file management over WebDAV / HTTP
GNU Lesser General Public License v2.1
85 stars 36 forks source link

davix-ls omits the content-type header #121

Open AlexandreTunstall opened 5 months ago

AlexandreTunstall commented 5 months ago

My WebDAV server is running Cyrus IMAP 3.6.1 (I think). When I try to use davix-ls to list the contents of a WebDAV directory, I get:

(Davix::HttpRequest) Error: HTTP 415 : Server Error

Adding --header 'Content-Type: application/xml' to the command works around the issue.

Note the following sentence in section 8.3 of RFC 9110

A sender that generates a message containing content SHOULD generate a Content-Type header field in that message unless the intended media type of the enclosed representation is unknown to the sender.

I could also report to the Cyrus IMAP developers that the WebDAV server should assume application/xml when unspecified, but I think their existing handling is entirely reasonable -- it's safer not to make assumptions about content type.


Version information:

Version: 0.8.6
Runtime curl version: 8.7.1 OpenSSL/3.0.13
Compiled against curl 8.7.1

OS: NixOS 24.05.1135.9b5328b7f761 (Uakari)