Accessing SharePoint with WebDAV, without files being returned as HTML

When mounting a SharePoint form library using gvfs over WebDAV, files stored as XML on the server are returned as the HTML presented to browsers. Other WebDAV clients on Mac and Windows successfully retrieve XML versions. What’s going on‽

Well, SharePoint supports a proprietary Translate: f request header to tell the server that it should return files verbatim. This is sent by Mac and Windows WebDAV clients, but not gvfs.

To test using curl, compare:

curl https://sharepoint.example.com/path/to/site/Library/foo.xml \
    -u"username:password"

and

curl https://sharepoint.example.com/path/to/site/Library/foo.xml \
    -u"username:password" -H"Translate: f"

I’ve created bug 688045 in the GNOME Bugzilla to ask that gvfs add this header to all requests. In the meantime, we’ll probably have to proxy SharePoint and add the header ourselves, or patch gvfs. Yay.

Posted in SharePoint and Exchange | 1 Comment

One Response to “Accessing SharePoint with WebDAV, without files being returned as HTML”

  1. Christopher Gutteridge says:

    God damn your eyes, SharePoint.

Leave a Reply