avisi/grunt-webdav-sync — pull request #5 by jfix (2014-01-05 00:42:06+00:00)
Title: missing remote directories is not actually an error

When trying to delete a non-existing remote directory, WebDAV returns a
207 so-called multistatus message to provide feedback from the server.
Until now these messages were treated as errors in the final ```else``` clause
in [line 52](https://github.com/avisi/grunt-webdav-sync/blob/master/tasks/webdav_sync.js#L52). 2xx actually indicate success and need specific treatment.

This pull request adds some initial support for multistatus messages. The
response body contains an XML document from which we extract the
```D:status``` element which contains the actual HTTP status message
(such as ```HTTP/1.1 404 Not found```). We inspect this status message and if
it’s a 404 we choose to not handle this as an error because remote
missing directories are actually quite normal.

More info on WebDAV multistatus messages: http://tools.ietf.org/search/rfc2518#section-11
More info on HTTP response status lines: http://tools.ietf.org/search/rfc2616#section-6.1

This resolves issue #1 for me.

Thank you for reviewing this pull request.