OS/X WebDAV and Chunked Transfer Encoding

While OS/X's WebDAV implementation is quite slow, it is mostly pretty decent. The client uses the little used Chunked transfer encoding for PUT requests, which allows it to send big files without knowing exactly how big the file is going to be. A request like this looks like this:

  1. PUT /image.png HTTP/1.1
  2. Host: example.org
  3. User-Agent: WebDAVFS/1.8 (01808000) Darwin/10.2.0 (i386)
  4. Accept: */*
  5. X-Expected-Entity-Length: 10316
  6. If: (<opaquelocktoken:44445502-c253-02e6-7198-45b36c96e8c7>)
  7. Connection: close
  8. Transfer-Encoding: Chunked

While this is a perfectly legal HTTP request, webservers choke on it. Both Nginx and Lighttpd respond with HTTP 411 Length Required. This would have been valid for HTTP/1.0 servers, but if they claim to support HTTP/1.1 they must accept these requests.

Apache + mod_php does this fine, but just recently I got a report from someone using Apache + fastcgi + php. In this case the request body never arrived in PHP which can unfortunately result in silent data loss.

So I guess that's a bit of a warning, so far OS/X WebDAV only plays nicely with Apache + mod_php servers.


1 Responses to OS/X WebDAV and Chunked Transfer Encoding

  1. 1037 Philip Hofstetter 2009-12-23 4:24 pm

    Also, I'd like to add that this usually breaks WebDAV if either the client or the server is behind a proxy server. As handling chunked requests usually needs some additional configuration on the proxy server.

Leave a Reply



About

My name is Evert, and I've been writing semi-regularly on this blog since 2006.

I'm currently available for contract work.

more info.

Subscribe

Dropbox

Dropbox is a simple cross-platform online backup and sync application. The first 2GB of space is free, and both you and me get an extra 250MB extra space if you sign up through this link.