evert/SabreDAV — pull request #20 by jtlebi (2012-03-16 19:22:52+00:00)
Title: Optional Content-Range support for PUT requests

I added a constant in Server.php to optionally activate Content-Range headers decoding in PUT requests. I left it optional because of the discussion in the code explaining why it was not already supported. Anyway, this feature is pretty cool when it comes to resuming an upload or sending a big file over the network.

In this code, I made several (documented) assumptions to keep the code as simple as possible.
* I accept only *one* range per requests. The RFC allows to specify more but I do not feel the need to do so.
* In case the file does not yet exist, the first offset is assumed to be 0. Otherwise an exception is raised. This avoided modifying the code too deeply.

I also added the wrappers in File.php in case the PutRange method is not supported to make this addition transparent to existing plugins.

Btw, this is disabled by default.