From 9c695fe0df5e81ce30f9023ee2a011f621fdbb42 Mon Sep 17 00:00:00 2001 From: Keith Ball Date: Fri, 21 Oct 2016 10:34:34 +0200 Subject: [PATCH] Return codes --- client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 7a7f53a..66cc293 100644 --- a/client.go +++ b/client.go @@ -82,6 +82,7 @@ type props struct { Size string `xml:"DAV: prop>getcontentlength,omitempty"` Modified string `xml:"DAV: prop>getlastmodified,omitempty"` } + type response struct { Href string `xml:"DAV: href"` Props []props `xml:"DAV: propstat"` @@ -323,7 +324,7 @@ func (c *Client) Write(path string, data []byte, _ os.FileMode) error { s := c.put(path, bytes.NewReader(data)) switch s { - case 200, 201: + case 200, 201, 204: return nil case 409: @@ -349,7 +350,7 @@ func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) error // TODO check if parent collection exists s := c.put(path, stream) switch s { - case 200, 201: + case 200, 201, 204: return nil default: