webdav: Support empty multistatus responses and simplify error handling.

Currently, the package-internal multistatus writer does not allow to
write empty XML multistatus elements. This conflicts with RFC 4918
(see [1]), and prevents to reuse the writer to implement REPORTs and
other WebDAV extensions. This CL adds support to write empty multi-
status responses. Based on this, it simplifies the error handling of
PROPFIND and PROPPATCH request handling.

[1] http://webdav.org/specs/rfc4918.html#ELEMENT_multistatus

Change-Id: I6ae56ec261ad3a0763b6c197ad1e9c2e30d988a6
Reviewed-on: https://go-review.googlesource.com/9186
Reviewed-by: Nigel Tao <nigeltao@golang.org>
3 files changed